2.9.0 Padding Bug
See original GitHub issue🐛 Bug
Information
Model I am using (Bert, XLNet …): Roberta with RobertaForSequenceClassification head
Language I am using the model on (English, Chinese …): Polish
The problem arises when using:
- the official example scripts: (give details below)
- my own modified scripts: (give details below)
The problem arises when performing a forward pass while training. I assume something is wrong with padding, though with 2.8.0 version it works correctly.
The tasks I am working on is:
- an official GLUE/SQUaD task: (give the name)
- my own task or dataset: (give details below)
I’m using pre-trained roBERTa model for classification task. Details can be found in the notebook below.
To reproduce
Steps to reproduce the behavior:
Error message:
56 # Perform a forward pass
---> 57 loss, logits = model(b_input_ids, token_type_ids=None, attention_mask=b_input_mask, labels=b_labels)
...
2033 """
2034 # The series of casts and type-conversions here are carefully balanced to both work with ONNX export and XLA.
-> 2035 mask = input_ids.ne(padding_idx).int()
2036 incremental_indices = torch.cumsum(mask, dim=1).type_as(mask) * mask
2037 return incremental_indices.long() + padding_idx
TypeError: ne() received an invalid combination of arguments - got (NoneType), but expected one of:
* (Tensor other)
didn't match because some of the arguments have invalid types: (!NoneType!)
* (Number other)
didn't match because some of the arguments have invalid types: (!NoneType!)
Expected behavior
It should work without errors. The problem arises after installing 2.9.0 version. With 2.8.0 version it works correctly.
Environment info
transformers
version: 2.9.0- Platform: Google colab
- Python version: 3.6.9
- PyTorch version (GPU?): 1.5.0+cu101
- Tensorflow version (GPU?): 2.2.0rc4
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: n/a
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
2.9.0.beta7: Security fix, bug fixes and more - Discourse Meta
Security Updates This beta includes 1 security fix following an advisory on an upstream dependency. For more information, check the security ...
Read more >Icinga Web 2 Changelog
This update's main focus is to solve the issue that all history views didn't work correctly or showed invalid time and dates. (#4853) ......
Read more >Releases for Base USWDS - United States Web Design System
Issue #3179547: USWDS 2.9.0 and 2.10.0 Released Issue #3196387: legend not showing up on taxonomy reference field. Issue #3200437: Strings in template files ......
Read more >4. Release Notes — Buildbot 2.9.0 documentation
Fixed a bug preventing the timeout=None parameter of CopyDirectory step from ... of www-badges to support additional padding configuration (issue # 5079).
Read more >Log4j – Changes - Apache Logging Services
2.0.2, 2014-08-16, Bug fixes and enhancements ... 2.9.0 -> 2.11.1 - org.apache.maven.plugins:maven-failsafe-plugin .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
trouble shooting
just modify ‘pad_token_id: null’ to ‘pad_token_id: 1’ in
config.json
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.