anaconda installation tensorflow and pytorch

anaconda installation tensorflow and pytorch

Download anaconda

Tsinghua mirror source (https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/), you can download the latest free installation brain, there is a place to note, this place are on the hook.Here Insert Picture Description

Start the installation tensorflow

Open anaconda prompt, create a virtual environment, input conda create -n tensorflow python = 3.6. Here Insert Picture Description
Open anaconda navigator, then the virtual environment has been built and 2, respectively, in the not install search tensor, ipython, jupyter, left tick, and then apply (I have no GPU, and some people optional tensorflow_gpu). Here Insert Picture Description
Open anaconda prompt, enter activate tensorflow, enter jupyter notebook!
Here Insert Picture DescriptionHere Insert Picture DescriptionOr in anaconda prompt, activate tensorflow, and then enter the python, can verify import tensorflow as tf, passes.

Installation pytorch

打开anaconda prompt,创建pytorch 虚拟环境,输入conda create -n pytorch python=3.6Here Insert Picture Description打开anaconda prompt,输入activate pytorch,在pytorch环境中,输入:conda install pytorch -c pytorch,开始安装pytorch,同样需要输入y,继续安装。
安装完成后,在pytorch环境中输入:python,显示python版本信息,并进入到python里,输入:import torch,测试是否安装成功。
继续安装torchvision,重新打开anaconda prompt,输入activate pytorch,在pytorch环境中,输入:conda install torchvision -c pytorch(conda如果不行也可以试一下pip install torchvision -c pytorch),同样需要输入y,继续安装。
安装完成后,在pytorch环境中输入:python,显示python版本信息,并进入到python里,输入:import torchvision,测试是否安装成功。
打开anaconda navigator,这时虚拟环境已建好,在not install 下分别搜索ipython,jupyter ,左边打勾,然后apply。Here Insert Picture Description
打开anaconda prompt,输入activate pytorch,输入jupyter notebook
测试
import torch
import torchvision

Published an original article · won praise 0 · Views 38

Guess you like

Origin blog.csdn.net/hyzhyzhyz12345/article/details/104020435