当前位置: 首页 > news >正文

在 ubuntu20.04 上安装 Pytorch

参考资料:https://www.linode.com/docs/guides/pytorch-installation-ubuntu-2004/

sudo apt update
sudo apt install nvidia-cuda-toolkit (3G)
mkdir anaconda
cd ~/anaconda
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
chmod +x ./Anaconda3-2020.11-Linux-x86_64.sh
sudo ./Anaconda3-2020.11-Linux-x86_64.sh

Scroll through the license agreement and agree to it by entering Yes. Indicate the destination directory for Anaconda. The default directory is ~/anaconda.

注意:在安装 anaconda 的时候(执行 Anaconda3-2020.11-Linux-x86_64.sh 脚本的时候),会要求你输入安装目录,这里我们不能提前 mkdir 那个目录,路径必须设定为一个不存在的路径才不会报错

TODO: here

The installer prompts you to initialize Anaconda3 by running conda init. We recommend entering yes (if you enter no, conda cannot modify your shell scripts).

You are now ready to install PyTorch and PyTorch tools using Anaconda. From the ~/anaconda directory install PyTorch:

 conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

在我这里,conda 命令并不能使用,可以在 anaconda3/bin/ 目录下找到 conda 命令,建议设置一个软连接到 /usr/local/bin/ 里

sudo apt install python3-pip
pip3 install torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

如果要安装 GPU/NVIDA 库,使用如下代码

pip3 install -f torch torchvision

end

http://www.lryc.cn/news/163505.html

相关文章:

  • 远程恋爱网站部署秘籍——群晖虚拟机助ni秀恩爱
  • vscode c++解决包含头文件红色波浪线问题
  • PostgreSQL docker compose安装配置
  • 电脑文件批量重命名:高效操作技巧
  • c高级day4(shell)
  • 整十粉丝庆祝文章系列内容征集建议
  • 两数乘积:输出1~100整数乱序列表中两数乘积是目标整数的最小下标对
  • 【JavaSE】面试01
  • Elasticsearch(二)kibana数据检索
  • JavaScript编程语法作业
  • 服务器中了Malloxx勒索病毒应该怎么办?勒索病毒解密,数据恢复
  • 如何实现Spring的事务管理功能:@Transactional声明式事务
  • LeetCode(力扣)122. 买卖股票的最佳时机 II
  • 串行通信协议
  • Elasticsearch中RestClient使用
  • 【LeetCode-中等题】208. 实现 Trie (前缀树)
  • python队列与多线程——生产者消费者模型
  • idea的安装
  • Unity下如何实现RTMP或RTSP播放端录像?
  • 【Python】Python基础语法
  • I2C总线驱动:裸机版、应用层的使用、二级外设驱动三种方法
  • Unix Network Programming Episode 77
  • 解决Ubuntu无法安装pycairo和PyGObject
  • Android Handler 机制解析
  • 酒店固定资产管理怎么分类
  • OpenCV(三十一):形态学操作
  • Python之面向对象(二)
  • ESP32用作经典蓝牙串口透传模块与手机进行串口通信
  • Python 操作 CSV
  • 自动化运维工具Ansible教程(二)【进阶篇】