conda 安装torch
时间: 2023-09-12 07:09:14 浏览: 204
要使用conda安装torch,可以使用以下命令:
conda install pytorch torchvision cudatoolkit=9.0
请注意,在安装时去掉"-c pytorch",这样安装时会默认从清华源下载相应的包。因此,正确的命令是:
conda install pytorch torchvision cudatoolkit=9.0
如果你想安装CPU版本的torch,可以使用以下命令:
conda install pytorch torchvision cpuonly -c pytorch
另外,你也可以选择源码安装torch和torchvision。你可以在GitHub上找到对应的版本并下载。torch和torchvision的对应关系如下:
torch-1.xx.0-cp38-cp38m-linux_x86_64.whl
torchvision-0.xx.0-xxx.xxx-xxx-xxx.whl
你可以使用pip来安装这些文件,例如:
pip install torch-1.xx.0-cp38-cp38m-linux_x86_64.whl
pip install torchvision-0.xx.0-xxx.xxx-xxx-xxx.whl
希望这些信息对你有帮助!\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [Conda建立虚拟环境及torch安装](https://blog.csdn.net/qq_29893385/article/details/95092643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [conda命令记录、torch、torchvision安装](https://blog.csdn.net/qq_27245699/article/details/127122780)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文