Fix get_num_classes
error in training notebook step 6
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The TalkNet training notebook installs
pytorch-lightning==1.3.8
, which importsget_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: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.