Error after labelling frames

Hello everyone

I am working on macOS Catalina using the terminal in DLC-CPU environment with pythonw.

I labelled the extracted frames, and I get as an output in the labeled-data folder two collectedData files (.csv and .h5). So I assume that the labelling worked.

But when I want to check the labels or create a training dataset I get following error:

Creating images with labels by Charis.
Traceback (most recent call last):
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/gui/", line 94, in check_labelF
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/generate_training_dataset/", line 300, in check_labels
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/generate_training_dataset/", line 310, in MakeLabeledPlots
    image = io.imread(os.path.join(cfg['project_path'],imagename))
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/skimage/io/", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/skimage/io/", line 210, in call_plugin
    return func(*args, **kwargs)
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/skimage/io/_plugins/", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/imageio/core/", line 267, in imread
    return reader.get_data(0)
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/imageio/core/", line 346, in get_data
    im, meta = self._get_data(index, **kwargs)
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/imageio/plugins/", line 301, in _get_data
    im, info = PillowFormat.Reader._get_data(self, index)
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/imageio/plugins/", line 170, in _get_data
    i = self._im.tell()
  File "/Applications/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/PIL/", line 827, in tell
    return self.__frame
AttributeError: 'PngImageFile' object has no attribute '_PngImageFile__frame'

Does someone has any advice what the problem might be?
Thanks you!

hi Sofia, welcome to the forum! Strange error! Could you tell me what version of skimage you have installed?
in the env:
import skimage

Hi Mackenzie

Thank you for your answer!

I have skimage version 0.16.2

I was getting the same error when refining labels.

I tracked the problem down to Pillow (7.1.0), and is mentioned on their GitHub. They fixed it fairly quickly, so it should only affect people who installed their env within the past week.

To fix an existing env:

conda activate DLC-CPU
pip install Pillow --upgrade



Hi Brandon
Thank you for your help! This worked for me.

1 Like