tnikolla / robot-grasp-detection

Detecting robot grasping positions with deep neural networks. The model is trained on Cornell Grasping Dataset. This is an implementation mainly based on the paper 'Real-Time Grasp Detection Using Convolutional Neural Networks' from Redmon and Angelova.
Apache License 2.0
232 stars 84 forks source link

New to tensorflow and TFRecords - error in running build_cd_dataset.py #28

Closed ElijahAlmanzor closed 4 years ago

ElijahAlmanzor commented 4 years ago

I seem to get this error: I'm using Spyder/Anaconda with Python 3.6 f.read() jsut doesn't seem to like opening images

File "C:/Users/Elijah/Desktop/Masters and Machine Learning folder/Cornell Dataset/robot-grasp-detection-master/build_cgd.py", line 31, in _process_image image_data = f.read()

File "C:\Users\Elijah\Anaconda3\envs\mle_gpu\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 50: character maps to

Any help would be appreciated, thanks

SpaceHan commented 3 years ago

try using tf.gfile rather than open() to read png file

image_data = tf.gfile.FastGFile(filename, 'rb').read()