pytorch=0.2.0,torchvision=0.2.0,虚拟环境安装

$:conda create -n test python=3.6

建虚拟环境

$:source activate test

激活环境

$:which python

:/home/hhp/.conda/envs/test/bin/python

查看该环境中的python版本

$:/home/hhp/.conda/envs/test/bin/python

检验是否有torch,此处应该没有

$:conda install pytorch=0.2.0 cuda80 -c pytorch

安装

$:pip install torchvision==0.2.0

安装

$:/home/hhp/.conda/envs/test/bin/python

检验安装的东西和版本

$:conda list

查看安装列表

 

有时需要将某个环境复制到另一个新环境中,则

先在源环境导出所有的依赖:

$ pip freeze > requirements.txt

然后在另一个目标新环境(或虚拟环境)中恢复:

$ pip install -r requirements.txt

 

spams安装:

按上述方式装好其他环境之后,再根据spams之git(https://github.com/conda-forge/python-spams-feedstock)安装spams会出现numpy版本问题,采用简单版本 ‘’pip install --index-url https://test.pypi.org/simple/ spams‘’安装即可,采自官网http://spams-devel.gforge.inria.fr/downloads.html

你可能感兴趣的:(pytorch=0.2.0,torchvision=0.2.0,虚拟环境安装)