Skip to content

Conversation

PluieElectrique
Copy link

The TalkNet training notebook installs pytorch-lightning==1.3.8, which imports get_num_classes from the torchmetrics package. However:

  • get_num_classes was removed in v0.8.0, so torchmetrics v0.7.3 is the last version compatible with Lightning v1.3.8.

  • Lightning v1.3.8 only requires torchmetrics>=0.2.0, so pip can install a version of torchmetrics newer than v0.7.3, leading to this error in step 6 of the training notebook:

    ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data'

    This error has occurred quite a few times already (April 27, May 8, May 25, June 22).

This PR prevents this from happening by requiring torchmetrics<=0.7.3. (It should fix the problem, but I haven't tested it myself.) This change could also be made in step 4 of the training notebook, if that's more convenient.

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

Successfully merging this pull request may close these issues.

1 participant