-
Notifications
You must be signed in to change notification settings - Fork 131
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
Issue in importing Apex #5
Comments
I had the same issue. If you didn't import apex, it will work fine, but I think that is used for faster computation. |
Also, you can install it using their GitHub page. |
If I don't import apex, the following statement fails. from pytorch_pretrained_bert.modeling import BertForPreTraining, BertPreTrainedModel, BertModel, BertConfig, BertForMaskedLM, BertForSequenceClassification I would like to know whether the above import worked fine without import apex. I am getting the following error without importing apex. Any suggestions would be really helpful. TypeError Traceback (most recent call last) /anaconda3/lib/python3.7/site-packages/pytorch_pretrained_bert/init.py in /anaconda3/lib/python3.7/site-packages/pytorch_pretrained_bert/modeling.py in /anaconda3/lib/python3.7/site-packages/apex/init.py in /anaconda3/lib/python3.7/site-packages/apex/interfaces.py in /anaconda3/lib/python3.7/site-packages/apex/interfaces.py in ApexImplementation() /anaconda3/lib/python3.7/site-packages/zope/interface/declarations.py in implements(*interfaces) TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead. |
What Python version are you using? Try it with 3.6 |
I am using Python 3.7. I read in the forums that moving back to 3.6 should solve the problem. I'll try and let you know. Thanks for your help |
Was able to solve it with
|
I am having issues while importing apex. I get an error similar to the ones posted in run_classifier repository.
in
----> 1 import apex
2 import pandas as pd
3 import numpy as np
4 import torch
5
/anaconda3/lib/python3.7/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,
/anaconda3/lib/python3.7/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
/anaconda3/lib/python3.7/site-packages/apex/interfaces.py in ApexImplementation()
12 applications
13 """
---> 14 implements(IApex)
/anaconda3/lib/python3.7/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.
Could anyone help me with this?
The text was updated successfully, but these errors were encountered: