Error in Colab Create a training dataset. AttributeError: can't set attribute

deeplabcut

#1

when trying to Create a training data set I get this error:

/content/drive/My Drive/DeepLabCut/pigeon2-cristian-2019-03-09/training-datasets/iteration-0/UnaugmentedDataSet_pigeon2Mar9 already exists!
/content/drive/My Drive/DeepLabCut/pigeon2-cristian-2019-03-09/labeled-data/C:\deeplabcut\pigeon2-cristian-2019-03-09\videos\Nh8/CollectedData_cristian.h5 not found (perhaps not annotated)
Annotation data was not found by splitting video paths (from config[‘video_sets’]). An alternative route is taken…
The following folders were found: [‘Nh8’]
It appears that the images were labeled on a Windows system, but you are currently trying to create a training set on a Unix system.
In this case the paths should be converted. Do you want to proceed with the conversion?
yes/noy
Annotation data converted to unix format…

AttributeError Traceback (most recent call last)
in ()
----> 1 deeplabcut.create_training_dataset(path_config_file)

/usr/local/lib/python3.6/dist-packages/deeplabcut/generate_training_dataset/trainingsetmanipulation.py in create_training_dataset(config, num_shuffles, Shuffles, windows2linux)
482 # load image to get dimensions:
483 filename = Data.index[jj]
–> 484 im = io.imread(os.path.join(cfg[‘project_path’],filename))
485 H[‘image’] = filename
486

/usr/local/lib/python3.6/dist-packages/skimage/io/_io.py in imread(fname, as_gray, plugin, flatten, **plugin_args)
60
61 with file_or_url_context(fname) as fname:
—> 62 img = call_plugin(‘imread’, fname, plugin=plugin, **plugin_args)
63
64 if not hasattr(img, ‘ndim’):

/usr/local/lib/python3.6/dist-packages/skimage/io/manage_plugins.py in call_plugin(kind, *args, **kwargs)
212 (plugin, kind))
213
–> 214 return func(*args, **kwargs)
215
216

/usr/local/lib/python3.6/dist-packages/skimage/io/_plugins/pil_plugin.py in imread(fname, dtype, img_num, **kwargs)
34 if isinstance(fname, string_types):
35 with open(fname, ‘rb’) as f:
—> 36 im = Image.open(f)
37 return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
38 else:

/usr/local/lib/python3.6/dist-packages/PIL/Image.py in open(fp, mode)

/usr/local/lib/python3.6/dist-packages/PIL/Image.py in _open_core(fp, filename, prefix)

/usr/local/lib/python3.6/dist-packages/PIL/ImageFile.py in init(self, fp, filename)
95
96 try:
—> 97 self._open()
98 except (IndexError, # end of data
99 TypeError, # end of data (ord)

/usr/local/lib/python3.6/dist-packages/PIL/PngImagePlugin.py in _open(self)
553
554 self.mode = self.png.im_mode
–> 555 self.size = self.png.im_size
556 self.info = self.png.im_info
557 self.text = self.png.im_text # experimental

AttributeError: can’t set attribute

Thank you.


#2

I solved this by reloading the steps. not sure what was the problem. Thank you


#3

Yes, I think this is a known colab error with PIL (sometimes loads in a corrupt fashion).