-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlairEmbeddings function gives ValueError in python 3.6 (latest Nvidia Pytorch Docker container) #1744
Comments
@tylerlekang thanks for reporting this. Could you print the torch version you get with |
@alanakbik Used
Did you test with this container? It seems like a common and important container to verify, as it is official Nvidia optimized for PyTorch applications. Thank you very much for your support! :) |
@alanakbik In the models/language_model.py code, the first line of _apply is (starts at line 402):
If I simply run
However, on my local machine running vanilla python 3.7.7, the torch version is just I have no idea why Nvidia has chosen this version of Pytorch with letters in the version number, but they did make this choice and this container is supposed to be an easy solution for highly optimized GPU runs on their hardware. Do you have any workaround ideas? |
@alanakbik could I just hardcode the major, minor, build numbers, in my local version of language_model.py if there is no workaround?
It seems the code just checks that the major.minor is >= 1.4 ? But I don't want to mess up any other parts of the code. |
Yes, I guess you could just overwrite import torch
torch.__version__ = '1.5.0' Meanwhile, I will put in a PR to fix the error. |
@alanakbik just wanting to triple-confirm, that shouldn't cause any problems with the rest of the FlairEmbeddings or LanguageModelTrainer codes? Thank you! |
It shouldn't cause any problems on the flair side. We use the string to determine whether and old version of torch is used (<1.4.0) or not, so changing it to another string that is above 1.4.0 won't change anything. |
GH-1744: remove torch version checks
Describe the bug
Simply running the code
FlairEmbeddings('news-forward')
gives aValueError
, in Python 3.6.10 (Conda), which is the python environment included in the most recent PyTorch Docker container from Nvidia. (https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel_20-06.html#rel_20-06)Here is the error message:
To Reproduce
Run this code in the container (after pip installing flair):
from flair.embeddings import FlairEmbeddings
FlairEmbeddings('news-forward')
Expected behavior
The function should work with no problems (in particular, the .lm is intended to be given to the LanguageModelTrainer function).
Environment (please complete the following information):
Additional context
Running the code in Python 3.7.7 (Conda) gives no problems.
The text was updated successfully, but these errors were encountered: