【torchlars】windows下载github中的torchlars包遇到的问题及解决方案

环境

python3.7
windows10
cuda11.1
pytorch1.8.1
虚拟环境miniconda

目的

windows下载github中的torchlars包

遇到的问题

问题一:直接下载好文件夹输入指令:python setup.py install
出现错误:RuntimeError: Error compiling objects for extension
解决方法:应先输入python setup.py build develop

问题二:subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.
解决方法:
修改torchlars 中的setup文件:

# cmdclass={'build_ext': BuildExtension},
cmdclass={'build_ext': BuildExtension.with_options(use_ninja=False)},

具体步骤

1、检查Microsoft Visual Studio的版本(需2017、2019),如没有Microsoft Visual Studio或者版本不对,会出现bug:
fatal error C1189: #error: – unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag ‘-allow-unsupported-compiler’ can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc.exe’ failed with exit code 2

2、python setup.py build develop
3、python setup.py install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值