text: 
  
  TITLE
  Metrics calculate error: can only calculate the mean of floating types. Got Bool instead
  
  COMMENTS
  2
  
  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: 3.3.1
  - Platform: Ubuntu 18.04
  - Python version: 3.7.7
  - PyTorch version (GPU?): 1.6.0 GPU
  - Tensorflow version (GPU?): -
  - Using GPU in script?: Yes
  - Using distributed or parallel set-up in script?: Yes
  
  ### Who can help
  Someone working on the examples/GLUE benchmarks 
  
  ## Information
  
  Model I am using (Bert, XLNet ...): BERT
  
  The problem arises when using:
  * [X] the official example scripts: (give details below)
  * [ ] my own modified scripts: (give details below)
  
  The tasks I am working on is:
  * [X] an official GLUE/SQUaD task: (GLUE
  * [ ] my own task or dataset: (give details below)
  
  ## To reproduce
  
  Steps to reproduce the behavior:
  
  1. Run QNLI experiment
  
  Error:
  ```bash
  File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/transformers/data/metrics/__init__.py", line 73, in glue_compute_metrics
      return {"acc": simple_accuracy(preds, labels)}
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/transformers/data/metrics/__init__.py", line 34, in simple_accuracy
      return (preds == labels).mean()
  RuntimeError: Can only calculate the mean of floating types. Got Bool instead.
  Exception ignored in: <function tqdm.__del__ at 0x7f8d1d09ff28>
  Traceback (most recent call last):
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/tqdm/std.py", line 1086, in __del__
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/tqdm/std.py", line 1293, in close
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/tqdm/std.py", line 1471, in display
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/tqdm/std.py", line 1089, in __repr__
    File "/home/lucadiliello/anaconda3/envs/nlp/lib/python3.7/site-packages/tqdm/std.py", line 1433, in format_dict
  TypeError: cannot unpack non-iterable NoneType object
  ```
  
  A simple fix is to modify `transformers/data/metrics/__init__.py", line 34, in simple_accuracy` to:
  ```python
  return (preds == labels).to(dtype=torch.float32).mean()
  ```
  
  ## Expected behavior
  
  Metric should be computed without problems