I am having issues with the official installation procedure, where running python -m pytest -sv ./examples fails with an opaque error message (below).
Steps to reproduce the behavior:
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html)pip install transformers)pip install pytest)python -m pytest -sv ./transformers/tests/; no tests failpython -m pytest -sv ./examples/; fails requiring tensorboardXpip install tensorboardX)python -m pytest -sv ./examples/; fails with message:==================================== ERRORS ====================================
__________________ ERROR collecting examples/test_examples.py __________________
ImportError while importing test module '/home/evancw/Projects/transformers/examples/test_examples.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
examples/test_examples.py:30: in <module>
import run_glue
examples/run_glue.py:49: in <module>
from transformers import glue_compute_metrics as compute_metrics
E ImportError: cannot import name 'glue_compute_metrics'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.64s ===============================
I would expect the tests to pass.
Please let me know if there is any more information I can provide.
@evanweissburg Hi, i got the same error..have you found any solution???
Hello! I believe you must have sklearn installed in order to pass these tests. Please let me know if it doesn't work while having sklearn installed.
yeah got it .... i guess we need to run pip install -r ./examples/requirements.txt
Indeed!
Could we add this to the getting started documentation?
pip install -r ./examples/requirements.txt
Had the same issue. Probably a problem with sklearn. Installed with conda and it was fixed.
Most helpful comment
Could we add this to the getting started documentation?
pip install -r ./examples/requirements.txt