Error running label_frames or refine_labels

I recently updated my Nvidia driver/CUDA/cudnn and am now getting an error while trying to run either label_frames or refine_labels:

ImportError: Cannot load backend ‘TkAgg’ which requires the ‘tk’ interactive framework, as ‘wx’ is currently running

I’m guessing this is an issue with how the GUI is called?

We are having the same problem running on windows 10, running on a CPU. Can’t extract frames.

Found a solution here:

type:

import matplotlib
matplotlib.use(‘Agg’)

this solved the issue, but seems like a temporary solution.

Ah, should have checked there first. But this works for me, thanks!

are you both using 2.0.6.3?

are you both using 2.0.6.3?

I am, yes.

Yes. Was a new install from the conda env files

And only in a Jupyter notebook on Windows?

No, I was running it from cmd.

We’ve got the same problem here, though the
matplotlib.use(‘Agg’)
isn’t working for us either.

can you be more specific; which version, what operating system, steps taken. I.e. can you get this error the first time you ipython, import deeplabcut, deeplabcut.label_frames?

It might be the new behavior of matplotlib: https://matplotlib.org/3.1.0/api/api_changes.html
https://matplotlib.org/3.1.0/api/api_changes.html#behavior-changes

so, can you pip install matplotlib==3.0.3

when i use matplotlib.use(‘wxAgg’)
it worked but it didn’t show red dot in the figures

okay the error source is matplotlib! please downgrade by installing (inside your conda env!)"

pip install matplotlib==3.0.3

1 Like

thank you so much
it worked but it still didn’t show red dot in the figures when i clicked my mouse

1 Like

be sure to use a “right click” and set the point size to be larger, just in case! (click the Help button for more info!)

Great, it worked, thank so much for your help :grinning:

1 Like