1.安装错误

安装apex库时,执行安装 pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./,报错:

ERROR: Command errored out with exit status 1: /home/xxx/anaconda3/envs/smplx_1.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-jhg5md0f/setup.py'"'"'; __file__='"'"'/tmp/pip-req-buil
d-jhg5md0f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.Str
ingIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close()
;exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-c_j8tg1m/install
-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/anaconda3/envs/smplx_1.7/include/python3.7m/apex Check the logs for full command output.
...................................
...................................
pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: /home/xxx/anaconda3/envs/smplx_1.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-jhg5md0f/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-jhg5md0f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-c_j8tg1m/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/anaconda3/envs/smplx_1.7/include/python3.7m/apex Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-gajxl9v8'
  • 解决方案
    通过“nvcc -V”,检查cuda版本。我原始的cuda版本为10.2,修改cuda版本为10.0后安装成功。(服务器root用户可在/usr/local 建立cuda软连接进行修改;非root用户通过vim ~/.bashrc 中的export ... 配置进行修改。)

2.运行精度错误

另外,运行代码时出现了另一个错误:

RuntimeError: expected scalar type Float but found Half (data_ptr at /home/cy/anaconda3/envs/render/lib/python3.6/s ite-packages/torch/include/ATen/core/TensorMethods.h:6321)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7f32dc94a627 in /home/cy/anaconda3/envs/NHR /lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: float* at::Tensor::data_ptr() const + 0xa60 (0x7f32bbb33480 in /home/cy/anaconda3/envs/NHR/lib/python3.6/ site-packages/pointnet2-0.0.0-py3.6-linux-x86_64.egg/pointnet2_cuda.cpython-36m-x86_64-linux-gnu.so)
frame #2: group_points_wrapper_fast(int, int, int, int, int, at::Tensor, at::Tensor, at::Tensor) + 0x27 (0x7f32bbb34427 in /home/cy/anaconda3/envs/NHR/lib/python3.6/site-packages/pointnet2-0.0.0-py3.6-linux-x86_64.egg/pointnet2_cuda.cpython-36m -x86_64-linux-gnu.so)
frame #3: + 0x14947 (0x7f32bbb2c947 in /home/cy/anaconda3/envs/NHR/lib/python3.6/site-packages/pointnet 2-0.0.0-py3.6-linux-x86_64.egg/pointnet2_cuda.cpython-36m-x86_64-linux-gnu.so)
frame #4: + 0x11a06 (0x7f32bbb29a06 in /home/cy/anaconda3/envs/NHR/lib/python3.6/site-packages/pointnet 2-0.0.0-py3.6-linux-x86_64.egg/pointnet2_cuda.cpython-36m-x86_64-linux-gnu.so)frame #11: THPFunction_apply(_object*, _object*) + 0xa1f (0x7f330e1f6e3f in /home/cy/anaconda3/envs/NHR/lib/python3.6/site -packages/torch/lib/libtorch_python.so)
  • 解决方案:
    ① 安装旧版本apex
    使用旧版本apex解决问题:https://github.com/NVIDIA/apex/tree/088985936518be7e25795a30d8ab33affa9db6ed
    ② (不推荐)修改精度
    修改精度使其满足要求,例如:new_features = self.mlp(new_features) 输出精度为 ‘torch.float16’,但是‘new_features’ 输入变量是 ‘torch.float32’ 修改为new_features = self.mlp(new_features).type(torch.float32)

参考文献:RuntimeError: expected scalar type Float but found Half #4

python 安装pytorch apex 报错:“ERROR: Command errored out with exit status 1: /home/litt/anaconda3/envs/”相关推荐

  1. python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the

    python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the l ...

  2. ubuntu18.04安装python的mysqlclient==1.4.6报错ERROR Command errored out with exit status 1python setup

    安装python的mysqlclient==1.4.6报错 环境: ubuntu18.04 python 3.7.2 Django 2.2 想要使用Django来操作MySQL,报错: LookupE ...

  3. Python PIP Mysql-python 报错 ERROR: Command errored out with exit status 1: python setup.py egg_info C

    pip install mysql-python 安装Mysql-python时,报错,先看下错误内容: ERROR: Command errored out with exit status 1:c ...

  4. django2.0 在安装mysqlclient 报错ERROR: Command errored out with exit status 1: python setup.py egg_info

    环境:centos7 +  Django2.0 + python3.6 django2.0连接mysql需要安装PyMySQL和mysqlclient pip3 install PyMySQL pip ...

  5. PIP scrapydo时报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the log

    今天PIP安装scrapydo 包时,报错,图如下 ERROR: Command errored out with exit status 1: python setup.py egg_info Ch ...

  6. 安装 torch-scatter,torch-sparse 出现error: Command errored out with exit status 1

    部分内容参考文章,感谢这位博主 在已经正确安装pytorch的情况下,pip install torch-scatter, torch-sparse 仍然遇到问题, ERROR: Command er ...

  7. Mac os更新系统后安装scrapy报错error: command ‘xcrun‘ failed with exit status 1

    查看报错信息: In file included from src/twisted/test/raiser.c:4: In file included from /Library/Developer/ ...

  8. 安装kerberos报错 error: command 'gcc' failed with exit status 1

    pip install kerberos 报错:error: command 'gcc' failed with exit status 1 安装环境工具 yum install gcc libffi ...

  9. 安装MySQL-python报错 error: command 'gcc' failed with exit status 1解决方法

    错误如: _mysql.c:2331: error: '_mysql_ConnectionObject' has no member named 'open' _mysql.c:2338: error ...

最新文章

  1. 如何入门学习自动驾驶感知技术?
  2. 使用libjpeg显示JPEG图像在framebuffer 测试(八)
  3. python编程自学难吗-为什么很多人不建议自学python编程呢?
  4. Clipboard还能玩出花
  5. ORACLE SQL Developer日期显示格式设置
  6. 前端学习(2658):vue3优化
  7. java九年_Java 9明年9月釋出正式版
  8. Linux下修改系统时间并写入BIOS
  9. 在移动硬盘内安装centos7记录
  10. 角色建模师来谈谈VR游戏角色制作流程
  11. QQ如何应对中年困境?
  12. 环境变量和模式(Vite)
  13. LabVIEWCNN基础
  14. 10000多套机械手毕业设计 课程设计 毕业论文 图纸 分享/上下料机械手、搬运机械手、苹果采摘机械手、液压机械手、三自由度机械手、水果采摘机械手、六自由度机械手、焊接机械手、码垛机械手、四自由……
  15. PBOC/EMV之小额支付, 电子钱包和借贷记
  16. 张小龙演讲4小时之我认为重要的点
  17. python实现位置定位_python实现物体定位
  18. Linux内网网络测速(打流)工具iperf3使用教程
  19. [论文阅读] SqueezeSegV3: Spatially-Adaptive Convolution for Efficient Point-Cloud Segmentation
  20. 学习Java必知的超详细基础|【大学生博客大赛】

热门文章

  1. C# windows窗口应用程序切换主界面的显示内容
  2. 常用的mysql存储引擎及其特点
  3. Python自动化运维
  4. CentOS7 使用二进制部署 Kubernetes 1.15-1.17集群(均通用,已经尝试,细心)
  5. 《卸甲笔记》-多表查询之二
  6. 开启xmp1还是2_“吃鸡”新版本倒计时1天,2个经典模式升级回归,老玩家泪目了!...
  7. [Android]搜索框SearchView
  8. Visual Studio各版本区别
  9. Text-CNN 文本分类
  10. 人工智能的知识图,人工智能学习路线