Diana
Diana

Reputation: 99

No module named 'torcheval'

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

Upvotes: 0

Views: 3573

Answers (1)

Lucas F
Lucas F

Reputation: 36

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

Upvotes: 2

Related Questions