apex安装常见的三个报错并成功解决(亲测有效) |
您所在的位置:网站首页 › SEW软件MOVITOOLS安装报错 › apex安装常见的三个报错并成功解决(亲测有效) |
前三个方法我都遇到了错误,直到方法4才成功解决,建议看完全文后再决定使用哪种方法,或者直接使用方法4。 方法1一开始我使用如下命令进行安装, pip install apex安装成功后,进入python,执行语句import apex进行验证是否安装成功,得到报错 TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. 方法2于是在网上找了方法如下,遂将刚才安装的apex卸载,卸载命令为pip uninstall apex,然后根据如下的网上方法安装 git clone https://www.github.com/nvidia/apex cd apex python setup.py install安装好后再次进行验证,得到报错如下 TypeError: unsupported operand type(s) for +: ‘NoneType‘ and ‘str‘ 方法3再次卸载,然后参考https://blog.csdn.net/qq_37844044/article/details/122625442,得到方法如下,相当于把方法2的第三行改为pip install -v --no-cache-dir ./ git clone https://github.com/NVIDIA/apex.git cd apex pip install -v --no-cache-dir ./安装好后再次验证,得到报错 AttributeError: module 'torch.distributed' has no attribute '_all_gather_base' 方法4再次卸载,然后参考这篇博文https://blog.csdn.net/weixin_44438120/article/details/112526744,方法如下 git clone https://github.com/ptrblck/apex.git cd apex git checkout apex_no_distributed pip install -v --no-cache-dir ./再次验证import apex成功(终于不报错了,搞了我两天呜呜呜) 注:遇到报错可以先翻github,比如在安装apex遇到报错时,可以进入https://github.com/NVIDIA/apex.git,点击issue,输入或粘贴报错查找是否有与自己有相同的问题的issue,看看别人是怎么解决的。最后祝大家好运! |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |