-
Notifications
You must be signed in to change notification settings - Fork 27k
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
TypeError: Class advice impossible in Python3 #163
Comments
Hi, I came across this error after running |
I uninstalled the old version of apex and reinstalled a new version. It worked. Thanks. git clone https://www.github.com/nvidia/apex |
I still have the problem in Google Colab |
Hello! I also had the problem and now I could solve it. Please install apex exactly as described above: git clone https://www.github.com/nvidia/apex Double check the following: The git command creates a folder called apex. In this folder is another folder called apex. This folder is the folder of interest. Please rename the folder on the top level (e.g. apex-2) and move the lower apex folder to the main level. Then python will also find the folder and it should work. Make sure that you have the version (0.1). Double check it with: "!pip list". |
The following command did the job for me (based on @fbaeumer's answer): |
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.
The text was updated successfully, but these errors were encountered: