-
Notifications
You must be signed in to change notification settings - Fork 1.5k
TypeError: Class advice impossible in Python3 #116
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
Comments
I uninstalled the old version of apex and reinstalled a new version. It worked. Thanks. git clone https://www.github.com/nvidia/apex |
I install follow your steps but it don't work. |
@demeiyan |
It works in my case. Thanks @lynnna-xu . |
Hi I do not think this issue should be closed at all. I have just replicated this issue on:
The proposed solution also did not help on any of the above. I therefore have to conclude that current Apex build is simply broken. EDIT: Error messages as per @ptrblck 's request Mac OS X
Nvidia-docker
EDIT 2:
This is after installing as per the official PyTorch command |
@jakubLangr |
@ptrblck done as per above. |
@jakubLangr Thanks for the error logs. |
Hi @ptrblck apologies I kept running into different errors when installing Will do some more investigating today. |
I got this issue with python3, but fixed by following @lynnna-xu with
|
pip3 uninstall apex && git clone https://www.github.com/nvidia/apex && cd apex && python3 setup.py install && rm -rf ../apex Just to make it one line ^^ |
It's appearing that the lib changed its name to pytorch extension => https://pypi.org/project/pytorch-extension/ |
That solves the problem perfectly! Thanks a lot 😊 |
I don't think it's an official release. |
thanks. I struggled with this issue for 2 days... it worked perfectly. |
TypeError Traceback (most recent call last)
in ()
----> 1 from pytorch_pretrained_bert import BertTokenizer
/opt/conda/envs/py3/lib/python3.6/site-packages/pytorch_pretrained_bert/init.py in ()
1 version = "0.4.0"
2 from .tokenization import BertTokenizer, BasicTokenizer, WordpieceTokenizer
----> 3 from .modeling import (BertConfig, BertModel, BertForPreTraining,
4 BertForMaskedLM, BertForNextSentencePrediction,
5 BertForSequenceClassification, BertForMultipleChoice,
/opt/conda/envs/py3/lib/python3.6/site-packages/pytorch_pretrained_bert/modeling.py in ()
152
153 try:
--> 154 from apex.normalization.fused_layer_norm import FusedLayerNorm as BertLayerNorm
155 except ImportError:
156 print("Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.")
/opt/conda/envs/py3/lib/python3.6/site-packages/apex/init.py in ()
16 from apex.exceptions import (ApexAuthSecret,
17 ApexSessionSecret)
---> 18 from apex.interfaces import (ApexImplementation,
19 IApex)
20 from apex.lib.libapex import (groupfinder,
/opt/conda/envs/py3/lib/python3.6/site-packages/apex/interfaces.py in ()
8 pass
9
---> 10 class ApexImplementation(object):
11 """ Class so that we can tell if Apex is installed from other
12 applications
/opt/conda/envs/py3/lib/python3.6/site-packages/apex/interfaces.py in ApexImplementation()
12 applications
13 """
---> 14 implements(IApex)
/opt/conda/envs/py3/lib/python3.6/site-packages/zope/interface/declarations.py in implements(*interfaces)
481 # the coverage for this block there. :(
482 if PYTHON3:
--> 483 raise TypeError(_ADVICE_ERROR % 'implementer')
484 _implements("implements", interfaces, classImplements)
485
TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead.
Hi, I came across this error after running import pytorch_pretrained_bert. My configurations are as follows:
torch version 1.0.0
python version 3.6
cuda 9.2
The text was updated successfully, but these errors were encountered: