How to install the module pytorch_lightning.metrics in Raspberry pi3

Viewed 6202

I am trying to execute a python file which has pytorch with lightning and torchvision modules. But after I downloaded and successfully installed whl file of pytorch in pi3 I am getting same error again and again. The error is

 ModuleNotFoundError: No module named 'pytorch_lightning.metrics'

Help would be highly appreciated as I am stuck for more than 3 days. I have installed the modules using pip.

4 Answers

I found maybe the 'pytorch_lightning.metrics' are updated to 'torchmetrics' package, try changing 'import pytorch_lightning.metrics' to 'import torchmetrics'

Use instead:

from torchmetrics.functional import accuracy

Try installing this version

!pip install pytorch-lightning==1.2.2

I solved it with the following installation:

pip install -q test_tube transformers pytorch-nlp pytorch-lightning==0.9.0

Worth trying.

Related