`pip install "lightning-flash[image]==0.8.1"` installs incompatible version of torchmetrics (`==0.11.0`)
yurijmikhalevich opened this issue ยท 3 comments
yurijmikhalevich commented
๐ Bug
Doing pip install "lightning-flash[image]==0.8.1"
installs torchmetrics==0.11.0
which is incompatible with the latest lightning-flash. This is stated in the lightning-flash requirements.txt
, but isn't respected by setup.py
๐ค:
Installing torchmetrics==0.10.3
fixes the error.
To Reproduce
- Create a new project
- Install
pip install "lightning-flash[image]==0.8.1"
- Try running an example from this page https://lightning-flash.readthedocs.io/en/latest/reference/image_classification.html
- Get an error:
Traceback (most recent call last):
File "train.py", line 20, in <module>
model = ImageClassifier(backbone="resnet18", labels=datamodule.labels)
File "/Users/yurij/miniforge3/envs/japanese-reader/lib/python3.8/site-packages/flash/image/classification/model.py", line 143, in __init__
super().__init__(
File "/Users/yurij/miniforge3/envs/japanese-reader/lib/python3.8/site-packages/flash/core/classification.py", line 120, in __init__
metrics, loss_fn = self._build(num_classes, labels, loss_fn, metrics, multi_label)
File "/Users/yurij/miniforge3/envs/japanese-reader/lib/python3.8/site-packages/flash/core/classification.py", line 67, in _build
metrics = F1Score(num_classes) if (multi_label and num_classes) else Accuracy()
TypeError: __new__() missing 1 required positional argument: 'task'
Expected behavior
No error. Example runs.
Environment
- OS (e.g., Linux): macOS
- Python version: 3.8.1
- PyTorch/Lightning/Flash Version (e.g., 1.10/1.5/0.7):
- GPU models and configuration:
- Any other relevant information:
yurijmikhalevich commented
I saw that 34caca4 hadn't been released yet. Leaving this issue open until the fix is out.
Borda commented
Borda commented