-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconda环境配置
44 lines (36 loc) · 1.52 KB
/
conda环境配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 创建name=‘torch’的虚拟环境
conda create -n torch python=3.7
# 进入虚拟环境
conda activate torch
# 安装pytorch-gpu==1.4.0
#正常情况下换成国内源会快上很多
# vim ~/.condarc
remote_connect_timeout_secs: 40.0
remote_read_timeout_secs: 500.0
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: True
#查看cuda版本号cuda==10.0
nvcc --version 或者 cat /usr/local/cuda/version.txt
#查看cudnn版本号
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
# CUDA 10.1 #实际为10.0,但实践证明好像也可以用!
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1
# 最后根据需要安装库就好了
# 创建name=‘tf’的虚拟环境
conda create -n torch python=3.6
#安装tensorflow
conda install tensorflow-gpu==1.15
#安装keras
conda install keras==2.3.6
# 当conda在下载和创建虚拟环境时报错的解决办法:
Error:anaconda :An unexpected error has occurred. Conda has prepared the above report......
方法:(源自:https://blog.csdn.net/LiuXiaoXueer/article/details/106823888)
1. conda clean --packages && conda clean --all && conda update --al
2. 遇到Proceed(y/n)? -> 输入y