NVIDIA / sentiment-discovery

Unsupervised Language Modeling at scale for robust sentiment classification
Other
1.06k stars 202 forks source link

Error ModuleNotFoundError: No module named 'torch.nn._functions.rnn' #41

Closed elixuy closed 5 years ago

elixuy commented 6 years ago

Hi I clone this project and run python3 setup.py install. everything is ok but when I run the script classifier.py --load_model lang_model_transfer/sentiment/sst_clf.pt --d ata data/icbu/icbu_negative_reviews.csv I get this error: Traceback (most recent call last): File "classifier.py", line 13, in <module> from apex.reparameterization import apply_weight_norm, remove_weight_norm File "/root/anaconda3/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/__init__.py", line 1, in <module> File "/root/anaconda3/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/RNN/__init__.py", line 1, in <module> File "/root/anaconda3/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/RNN/models.py", line 3, in <module> ModuleNotFoundError: No module named 'torch.nn._functions.rnn'

elixuy commented 5 years ago

I fix this by installing pytorch by bin other than from source

puramchendrasekhar1 commented 5 years ago

what is meant by installing pytorch by bin ? I am also facing same issue "ModuleNotFoundError: No module named 'torch.nn._functions.rnn'"

puramchendrasekhar1 commented 5 years ago

could you please tell me the command or some other solution to fix this

thak123 commented 4 years ago

Is this fixed ?

I fix this by installing pytorch by bin other than from source

do you mean you installed it from source rather than the pip option ?

aishoo1612 commented 4 years ago

i also have same problem while using nn.functional in colab. It ends up saying that their is no module named nn.functional. command that I have been using : import nn.functional as F