[日常填坑]图像分类实战(一)-服务器环境配置

服务器Ubuntu、pytorch框架、网络模型SE-Resnet50,优化算法Adam

pytorch(python优先的深度学习框架,是一个和tensorflow,Caffe,MXnet一样,非常底层的框架,它的前身是torch)

主要步骤(环境配置):

1. 需要下载cuda8.0

2. 需要下载pytorch(两种方法)

- 第一种方式:可以下载Anaconda(一个python的包管理工具),通过conda下载pytorch

- 第二种方式:可以直接下载pytorch(如以下命令行)

pip install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp27-cp27mu-linux_x86_64.whl 
pip install torchvision
 
# if the above command does not work, then you have python 2.7 UCS2, use this command 
pip install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp27-cp27m-linux_x86_64.whl
 
注意:链接名不要输错
 

 

第一种方式(下载的Anaconda,虽然比较大,但也可以用于其他python应用,十分方便)

1. 安装cuda8.0/cuda9.0

自行搜索教程(无坑)

 

2. 安装Anaconda
wegt https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-5.1.0-Linux-x86_64.sh
cd download
ls
bash Anaconda2-5.1.0-Linux-x86_64.sh

# 然后一路enter,最后yes

#配置conda环境变量(一直按enter键,到最后有一个让添加环境变量,你写yes,如果没有就需要手动添加)

http://www.cnblogs.com/gaofighting/p/8799169.html通过echo命令行手动添加环境变量
# 使用conda list查看安装的包,测试是否正确安装

# 置换镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

 

3. 安装pytorch
conda install pytorch torchvision -c pytorch

注意:如果机子上安装的cuda是9.0:conda install pytorch torchvision cuda90 -c pytorch

 

4. 验证pytorch是否正确安装
python
import torch

 

 

 

 

 

 

 

posted @ 2018-05-16 17:43  hoanfir  阅读(219)  评论(0编辑  收藏  举报