安装Apex报错: TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instea

安装Apex报错:

TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead.

 

不能直接pip install apex
卸载从新安装

pip uninstall apex
git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install

 

3.
更新:在使用bert的预训练模型pytorch-pretrained-BERT时,报错如下:
ModuleNotFoundError: No module named ‘fused_layer_norm_cuda’
原因是安装apex时没有安装cuda版本,所以要pip uninstall apex卸载(apex文件夹也一起删除)后,重新安装,具体安装步骤如下:
git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install --cuda_ext --cpp_ext

更新:

还是直接看官方GitHub上面的安装教程比较好:

For performance and full functionality, we recommend installing Apex with CUDA and C++ extensions via

$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

参考:

https://blog.csdn.net/Flying_sfeng/article/details/103314536

 

你可能感兴趣的:(安装Apex报错: TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instea)