Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'get_num_classes #74

Open
dave20012 opened this issue Apr 16, 2022 · 4 comments
Open

ImportError: cannot import name 'get_num_classes #74

dave20012 opened this issue Apr 16, 2022 · 4 comments

Comments

@dave20012
Copy link

dave20012 commented Apr 16, 2022

----> 3 from vqgan_clip import generate, esrgan, video_tools
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/usr/local/lib/python3.7/dist-packages/torchmetrics/utilities/data.py)

Im a newb so struggling (running on colab)

I did get it working at some point earlier.. but foolishly overwrite my changes and now cant remember what i changed to get it working..

any help appreciated
thanks for great package by the way..

@tonywhite11
Copy link

Same here. One day it's working fine then the next it's not. Not much on the web about it yet. Hopefully someone will see it soon bc this was one of the best I've seen yet. Here's what I'm getting. I've tried all s9olutions online plus I made up a few but still nothing.

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/utils.py in ()
20 from torchmetrics.utilities.data import dim_zero_mean as _dim_zero_mean
21 from torchmetrics.utilities.data import dim_zero_sum as _dim_zero_sum
---> 22 from torchmetrics.utilities.data import get_num_classes as _get_num_classes
23 from torchmetrics.utilities.data import select_topk as _select_topk
24 from torchmetrics.utilities.data import to_categorical as _to_categorical

ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/usr/local/lib/python3.7/dist-packages/torchmetrics/utilities/data.py)

@dave20012

This comment was marked as resolved.

@tonywhite11
Copy link

It's aliiive!!!! Bro, you're a life saver. Fan 4 life.

@bver
Copy link

bver commented May 8, 2022

Same here.
Thanks @dave20012 for your fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants