Git Product home page Git Product logo

Comments (7)

kaushaltrivedi avatar kaushaltrivedi commented on June 30, 2024 1

Can you update to the latest pytorch version?

from fast-bert.

hiwaveSupport avatar hiwaveSupport commented on June 30, 2024

I was able to use the learner object without issue and predict, but metrics part did not work.
Another issue also related to bool not being available as part of learner validate, trace is below:
09/08/2019 14:51:53 - INFO - root - Running evaluation
09/08/2019 14:51:53 - INFO - root - Num examples = 1000
09/08/2019 14:51:53 - INFO - root - Batch size = 8
100.00% [125/125 01:20<00:00]

AttributeError Traceback (most recent call last)
in ()
----> 1 learner.validate()

1 frames
/usr/local/lib/python3.6/dist-packages/fast_bert/metrics.py in accuracy_thresh(y_pred, y_true, thresh, sigmoid)
29 if sigmoid:
30 y_pred = y_pred.sigmoid()
---> 31 return ((y_pred > thresh) == y_true.bool()).float().mean().item()
32 # return np.mean(((y_pred>thresh)==y_true.byte()).float().cpu().numpy(), axis=1).sum()
33

AttributeError: 'Tensor' object has no attribute 'bool'

from fast-bert.

shyamrallapalli avatar shyamrallapalli commented on June 30, 2024

Hi i had this error
But i can't use pytorch 1.2 due to an error with apex
Sorry i am on Windows 10.
Any help or suggestion are greatly appreciated

from fast-bert.

ramakth1 avatar ramakth1 commented on June 30, 2024

i am also getting the same error , could you please let me know if you guys have rectified this error

from fast-bert.

shyamrallapalli avatar shyamrallapalli commented on June 30, 2024

i got around this error by using apex_no_distributed NVIDIA/apex#433 (comment)
first check as mentioned in following
NVIDIA/apex#433 (comment)

from fast-bert.

ramakth1 avatar ramakth1 commented on June 30, 2024

is it rectified ?

from fast-bert.

max-yue avatar max-yue commented on June 30, 2024

I just find a nice workaround by change
return ((y_pred > thresh) == y_true.bool()).float().mean().item()
to
return ((y_pred > thresh) == (y_true > 0.5)).float().mean().item()

and it works perfectly.

from fast-bert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.