学校的云服务器是Ubuntu16.04的,这给我在服务器上写pytorch带来很大不便。
有vscode remote,怎么能不为我的服务器配好武器呢。
环境
Ubuntu16安装pyenv,加Python3.7
sudo apt-get update -y
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev -y
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev -y
sudo apt-get install libssl-dev openssl -y
sudo apt-get install libffi-dev -y
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l
pyenv install 3.7.0 -v
pyenv rehash
pyenv versions
pyenv global 3.7.0
pip3 install torch torchvision -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
安装
bash ./Pyenv37Install.sh
大功告成!
update 2020/6/8
一个tensorflow安装脚本
sudo apt install python3-pip -y
pip3 install --upgrade pip
pip3 install tensorflow==2.0.0-beta1 -i https://pypi.douban.com/simple/