

TITLE
data_collator.py - line 326, in mask tokens - xlnet finetuning error

COMMENTS
9

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version: version: 3.2.0
- Platform: Linux-4.15.0-118-generic-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.6.9
- PyTorch version (GPU?): 1.5.1+cu101 (True)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.
  
 
 --> TransfoXL/XLNet: @TevenLeScao 

## Information

Model I am using (XLNet):

The problem arises when using:
* [ x] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

Testing simple example in 'language-modeling/examples/README'  using recommended wiki-2-raw dataset and xlnet-base cased model

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [x ] my own task or dataset: (give details below)

Same error occurs using simple one sentence per line text file (10 megs)

## To reproduce

Steps to reproduce the behavior:

1. Run all steps in 'language-modeling/examples/README' using xlnet-base-cased (cached or local)
2. Model loads with warnings and process begins before quickly exiting with the following error:

File "/home/pixelhead/Desktop/xlnet/transformers-master/transformers/data/data_collator.py", line 326, in mask_tokens
    "This collator requires that sequence lengths be even to create a leakage-free perm_mask. Please see relevant comments in source code for details."
ValueError: This collator requires that sequence lengths be even to create a leakage-free perm_mask. Please see relevant comments in source code for details.
Epoch:   0%|                                              | 0/3 [00:00<?, ?it/s]
Iteration:   0%|

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

Expect 'run_language_modeling.py' to work for xlnet as per 'language-modeling/examples/README'
Have tested addition of '--line_by_line' and 'block_size=128, 256, 512'  etc. Same error.

Could be missing something here 'Please see relevant comments in source code for details.' but not clear.

Cheers,