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

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?
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/ 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

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

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

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

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

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

/usr/local/lib/python3.6/dist-packages/PIL/ in init(self, fp, filename)
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/ in _open(self)
554 self.mode = self.png.im_mode
–> 555 self.size = self.png.im_size
556 = self.png.im_info
557 self.text = self.png.im_text # experimental

AttributeError: can’t set attribute

Thank you.

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

1 Like

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