rkhamilton / vqgan-clip-generator

Implements VQGAN+CLIP for image and video generation, and style transfers, based on text and image prompts. Emphasis on ease-of-use, documentation, and smooth video creation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'get_num_classes

dave20012 opened this issue · comments

----> 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..

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)

Hi Tony
Run everything the same as default if in colab

then before cell called
"Libraries"

Add a blank code cell and run

!pip install tf-estimator-nightly==2.8.0.dev2021122109
!pip install imgaug==0.2.6
!pip install pytorch-lightning==1.2.9

Error is becuase this 'get_num_classes' was depreciated after ver 1.2.9 in pytorch-lightniing


If I do the above, its works (for images anyway have not tried video)

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

Same here.
Thanks @dave20012 for your fix.