安装
https://blog.csdn.net/weixin_41335923/article/details/108368436
wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh bash Anaconda3-2021.11-Linux-x86_64.sh -p anaconda/ -u source ~/.bashrc
查看环境
conda info --e
创建环境
conda create -n env_name python=3.7
激活环境
conda activate env_name
停止环境
conda deactivate
删除环境
conda remove -n env_name --all
安装pytorch
https://zhuanlan.zhihu.com/p/106394476 版本对应:https://www.cnblogs.com/Wanggcong/p/12625540.html
conda install pytorch torchvision -c pytorch
# 限定版本
pip3 install torch==1.6.0 torchvision==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
测试gpu
https://zhuanlan.zhihu.com/p/268165089
import torch
from torch import nn
print(torch.cuda.is_available()) # true 查看GPU是否可用
print(torch.cuda.device_count()) #GPU数量, 1
torch.cuda.current_device() #当前GPU的索引, 0
torch.cuda.get_device_name(0) #输出GPU名称
安装tensorflow
conda install tensorflow
# 限定版本
conda install tensorflow-gpu=1.15
pip install tensorflow-gpu==1.15
## conda 安装可能会有gcc编译问题
测试gpu
https://blog.csdn.net/sunshine2124ch/article/details/103127551
import tensorflow as tf
tf.test.is_gpu_available()
查看cuda/cudnn版本:
nvcc --version
nvcc -V
cat /usr/local/cuda/version.txt
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
PREVIOUS用 Github pages 和 Jekyll 搭建博客
NEXTLR小结