No module named 'torcheval'

Question:

I am trying this on Kaggle:

from torcheval.metrics.functional import binary_f1_score
metric = binary_f1_score

And i get an Error:

ModuleNotFoundError                       Traceback (most recent call last)
/tmp/ipykernel_28/3857382439.py in <module>
----> 1 from torcheval.metrics.functional import binary_f1_score
      2 metric = binary_f1_score
      3 model_no_CV = unet_1D().to(device)
      4 optimizer =  torch.optim.Adam(unet_1D.parameters(), lr=0.001)
      5 epochs_num = 30

ModuleNotFoundError: No module named 'torcheval'

I tried to install the latest version of torch, didn’t help
Other torch modules seem to work correctly

Asked By: Diana

||

Answers:

You have to install torcheval library in Kaggle. First of all make sure your internet option is enable to use the kernel then you can try this command:

!pip install torcheval
Answered By: Lucas F
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.