Got it

Error message when convert dataset to mindrecord

Created: Sep 20, 2021 07:07:35Latest reply: Sep 21, 2021 09:42:50 333 4 0 0 0
  HiCoins as reward: 0 (problem unresolved)

I am using VOC dataset to train Fast-RCNN model using Mindspore, Unfortunatily when I try to convert my dataset to a Mindrecord I get the following error, although 7 mindscore files were created:


WARNING: Logging before InitGoogleLogging() is written to STDERR
[ERROR] DEBUG(11092,2,?):2021-9-19 16:42:53 [mindspore\ccsrc\debug\common.cc:280] SaveStringToFile] Open dump file 'C:\Users\Yaman\PycharmProjects\Mindsporeproject\somas_meta\somas_graph0_17123576251438239986.info' failed!
[ERROR] DEBUG(11092,2,?):2021-9-19 16:42:53 [mindspore\ccsrc\debug\common.cc:280] SaveStringToFile] Open dump file 'C:\Users\Yaman\PycharmProjects\Mindsporeproject\somas_meta\somas_graph0_17123576251438239986.json' failed!

This is the code that I used to convert my datatset into mindrecord: 


annos = []
file = pd.read_csv('Training_dataset.csv',header=None)
data=file.values.tolist()
image_files=[]
with open("image_files.csv") as file_name:
    image_path = np.loadtxt(file_name, delimiter=",", dtype='str')
image_path = np.delete(image_path, 0, 0)
for img in image_path:
    image_files.append(img)



def data_to_mindrecord_byte_image(is_training=True, prefix="fasterrcnn.mindrecord", file_num=8):
    """Create MindRecord file."""
    mindrecord_dir = config.mindrecord_dir
    mindrecord_path = os.path.join(mindrecord_dir, prefix)
    writer = FileWriter(mindrecord_path, file_num)
    fasterrcnn_json = {
    "image": {"type": "bytes"},
    "annotation": {"type": "int32", "shape": [-1, 5]},
}
    writer.add_schema(fasterrcnn_json, "fasterrcnn_json")
    for i, image_name in zip(data,image_files):
        with open(image_name, 'rb') as f:
            img = f.read()
    
        annos = np.array(i, dtype=np.int32)
        print('hi4')
        row = {"image": img, "annotation": annos}
        writer.write_raw_data([row])
    writer.commit()



image_files snapshot:

['C:/Users/Yaman/PycharmProjects/Mindsporeproject/JPEGImages_train\\001622.jpg', 'C:/Users/Yaman/PycharmProjects/Mindsporeproject/JPEGImages_train\\001622.jpg', 'C:/Users/Yaman/PycharmProjects/Mindsporeproject/JPEGImages_train\\001622.jpg', 'C:/Users/Yaman/PycharmProjects/Mindsporeproject/JPEGImages_train\\001622.jpg',]


where each row contains the image file.


annos snapshot: 

[404 374 300 300   9]

[283 375 162 326   9]

[500 375 426 305   9]

[100 374   2 259   9]


where each row contain the x1,y1,x2,y2,object_label for each object in corresponding image. 

Can someone tell me how to solve the error? 

Featured Answers

Recommended answer

olive.zhao
Admin Created Sep 20, 2021 08:00:34

Hello, friend!

What's the version of your MindSpore?

It is recommended to download version 1.4 MindSpore for a try and to download it from this link:

MindSpore

midspare

Hope this helps!

View more
  • x
  • convention:

All Answers
Hi,
We've noticed about your problem, and we're processing on it.
View more
  • x
  • convention:

Hello, friend!

What's the version of your MindSpore?

It is recommended to download version 1.4 MindSpore for a try and to download it from this link:

MindSpore

midspare

Hope this helps!

View more
  • x
  • convention:

Posted by olive.zhao at 2021-09-20 08:00 Hello, friend!What's the version of your MindSpore?It is recommended to download version 1.4 MindSpo ...
Okay, Thank you
Do I have to reinstall it again ?
View more
  • x
  • convention:

olive.zhao
olive.zhao Created Sep 28, 2021 05:46:17 (0) (0)
Yes, you can!  

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.