安装命令:
conda install pytorch 1.7.0 torchvision0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch -y
1.修改/root/.bashrc中的环境配置:
.bashrc文件只做了最后export的添加。
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vi='vim'
alias wc='watch -n 0.1 nvidia-smi'
alias ppy='ps -ef | grep python'
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/root/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/root/anaconda3/etc/profile.d/conda.sh" ]; then
. "/root/an