NVIDIA / sentiment-discovery

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

apex error #38

Open zhh210 opened 6 years ago

zhh210 commented 6 years ago

Somehow it keeps getting errors when running the cmd from colab:

!python3 transfer.py --load_model imdb_clf.pt

It yields error of: File "transfer.py", line 20, in <module> from apex.reparameterization import apply_weight_norm, remove_weight_norm File "/usr/local/lib/python3.6/dist-packages/apex/__init__.py", line 18, in <module> from apex.interfaces import (ApexImplementation, File "/usr/local/lib/python3.6/dist-packages/apex/interfaces.py", line 10, in <module> class ApexImplementation(object): File "/usr/local/lib/python3.6/dist-packages/apex/interfaces.py", line 14, in ApexImplementation implements(IApex) File "/usr/local/lib/python3.6/dist-packages/zope/interface/declarations.py", line 483, in implements raise TypeError(_ADVICE_ERROR % 'implementer') TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead.

raulpuric commented 6 years ago

What are your environment specs and also did you run python setup.py install?

nickto commented 5 years ago

Had the same issue, running python setup.py install solved the problem.

ChrystianSchutz commented 5 years ago

Even after python setup.py install I still have the same error. Installed apex 0.1 and running on AWS t2.2xlarge GPU

raulpuric commented 5 years ago

Sorry, other people are also having install errors. Please give us until after the holidays to fix this.

In the meantime copying apex to your working directory should solve import problems (cp -r apex_utils/apex .)

MichaMucha commented 5 years ago

Actually the methods being imported seem to refer to the directory reparameterization in the root directory of this repo, specifically to reparameterization/__init__.py

All you need to do to get over this hurdle is to remove the apex. part from. from apex.reparameterization import apply_weight_norm, remove_weight_norm in main.py and generate.py

edit: correct me if I'm wrong please. I understand the error message comes from the module "apex" available on pypi, which seems to be about authentication. Not sure why the authors used the word apex

raymondklutse commented 5 years ago

Actually the methods being imported seem to refer to the directory reparameterization in the root directory of this repo, specifically to reparameterization/__init__.py

All you need to do to get over this hurdle is to remove the apex. part from. from apex.reparameterization import apply_weight_norm, remove_weight_norm in main.py and generate.py

edit: correct me if I'm wrong please. I understand the error message comes from the module "apex" available on pypi, which seems to be about authentication. Not sure why the authors used the word apex

This worked for me.