因为电脑显卡rtx1060比较老,所以只能配“
OpenCV: 4.11.0 NumPy: 1.26.4 PyTorch版本: 1.12.0+cu113 CUDA可用: True
”这个环境比较稳定,但是安装类似accelerate这种包不注意加参数版本就会把pytorch卸载掉,重新安装很麻烦
首先anaconda prompt中输入
pip freeze | findstr torch > constraints.txtpip freeze | findstr torch > constraints.txt
再
:: 创建临时约束文件
pip freeze | findstr "torch" > temp_constraints.txt
:: 执行带约束的安装并捕获输出到临时日志
pip install --constraint temp_constraints.txt --dry-run --verbose accelerate==0.15.0 2>&1 > temp_output.log
:: 筛选并输出包含特定关键词的行
type temp_output.log | findstr /i "torch conflict error"
:: 清理临时文件
del temp_constraints.txt
del temp_output.log
type那段代码输出

表示没问题。
2357

被折叠的 条评论
为什么被折叠?



