Comments (7)
Can you update to the latest pytorch version?
from fast-bert.
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.
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.
i am also getting the same error , could you please let me know if you guys have rectified this error
from fast-bert.
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.
is it rectified ?
from fast-bert.
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)
- Not finding CUDA when building docker image
- Can not fine tuning lanague model using Colab HOT 1
- how to manage output values of prediction (predictor.predict_batch) HOT 2
- Target Batch Size Doubling: ValueError: Target size (torch.Size([16, 5])) must be the same as input size (torch.Size([8, 5])) HOT 1
- Missing token-level classification task
- Issue with BertNERPredictor.predict_batch(array)
- PicklingError: Can't pickle <class 'fast_bert.data_cls.InputFeatures'>: import of module 'fast_bert.data_cls' failed
- Support for Semantic Search/Semantic similarity
- Any way to save the model artifacts during training?
- lr_find() taking so much time when running readme.md example
- Converting a Pytorch Dataloader to BertDataBunch
- Error in `predict` for BertClassificationPredictor - logger is None
- can the version pins for tokenizers and transformers be removed, in requirements.txt? HOT 2
- [Suggestion] Pin requirement versions (specifically python-box) HOT 1
- [BUG] AttributeError: 'RobertaTokenizer' object has no attribute 'max_len'
- TypeError: forward() got an unexpected keyword argument 'masked_lm_labels'
- DtypeWarning: Columns (0,1) have mixed types. Specify dtype option on import or set low_memory=False HOT 2
- How to use cuDNN device with fast-bert HOT 2
- accuracy function only gives zero-output and breaks for new numpy version
- Creation of BertClassificationPredictor breaks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-bert.