【apex】Correct installation posture

every blog every motto: You can do more than you think.
https://blog.csdn.net/weixin_39190382?type=blog

0. Preface

NNGT,
apex installation is really laborious. It was installed once before, and it took a long time. But there is no record. This is not going to go the old way again, :)

One error after another during installation. . . Including but not limited to the following:

AttributeError: module ‘torch.distributed‘ has no attribute ‘_all_gather_base‘
cannot import name ‘amp‘ from “apex“ / from apex import amp
Warning: apex was installed without --cuda_ext

1. Text

clone down

git clone https://github.com/NVIDIA/apex

Uninstall if installed

pip uninstall apex
cd apex

If there is a build, delete

rm -rf build (if it exists)

Install

python setup.py install --cuda_ext --cpp_ext 

reference

[1] https://blog.csdn.net/hhhhhhhhhhwwwwwwwwww/article/details/128077560
[2] https://blog.csdn.net/weixin_59726951/article/details/127585754
[3] https://blog.csdn.net/qq_44741914/article/details/128087328
[4] https://blog.csdn.net/qq_42247018/article/details/115026338
[5] https://github.com/getalp/Flaubert/issues/13
[6] https://github.com/ptrblck/apex
[7] https://github.com/NVIDIA/apex/issues/86

Guess you like

Origin blog.csdn.net/weixin_39190382/article/details/130386025