船新UBUNTU 安装openai 从零开始 @TOC
新手上车,装了一个星期,从第一句cd命令开始,真是令人头皮发麻!
咱就从换源开始,一步步安装openai
sudo cp /etc/apt/sources.list sources_backup.list
sudo gedit /etc/apt/sources.list
#清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
#阿里云源
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
阿里源(ubuntu18.04)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
阿里源(ubuntu20.04)
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
阿里镜像站
https://developer.aliyun.com/mirror/ubuntu/?spm=a2c6h.25603864.0.0.47634af3iBaqpg
a.这个命令,会访问源列表里的每个网址,并读取软件列表,然后保存在本地电脑。我们在新立得软件包管理器里看到的软件列表,都是通过update命令更新的。
sudo apt-get update
b.解决各种缺少依赖问题
sudo apt-get -f install
c.这个命令,会把本地已安装的软件,与刚下载的软件列表里对应软件进行对比,如果发现已安装的软件版本太低,就会提示你更新。
sudo apt-get upgrade
1、卸载驱动
sudo apt-get remove nvidia-*
2、查询可用驱动
sudo ubuntu-drivers devices
会出现类似的 (每个版本 因时间推进而可能版本号不同 以自己的为准
driver : nvidia-driver-470 - distro non-free driver : nvidia-driver-460-server - distro non-free recommended driver : xserver-xorg-video-nouveau - distro free builtin
3、选取在上面列表中自己需要的列表中的驱动安装即可 一般不推荐安装test的驱动
sudo apt install nvidia-driver-470
4、检验驱动是否安装成功
sudo nvidia-smi
5、编辑内核
sudo nano /etc/modprobe.d/blacklist.conf
文件末尾加上 blacklist nouveau 然后保存
sudo update-initramfs -u
使改动生效,这句很重要
7、重启
sudo reoot
https://blog.csdn.net/sandalphon4869/article/details/100781978
https://jingyan.baidu.com/article/fec4bce28610c4f2618d8b13.html
(ubuntu18.04)
https://blog.csdn.net/qq_27211927/article/details/80877684
IBus与fcitx切换的时候记得要重启
/opt/v2ray/v2ray-linux-64/v2ray
/opt/v2ray/v2ray-linux-64
bash xxxxx
这个是openai官方的教程页面
官方历史版本,找到Anaconda3-5.3.0-Linux-x86_64.sh
官方教程用的是5.3.0,跟着官方推荐一步一步装准没错!
https://repo.anaconda.com/archive/
下载完成,打开终端,进行安装
bash ~/Downloads/Anaconda3-5.3.0-Linux-x86_64.sh
安装完成后需要关闭终端再次打开,Anaconda才能生效
创建一个spinningup的环境(这个名字可以随便改) 使用python3.6
conda create -n spinningup python=3.6
在之前创建好的环境中继续安装 接下来的环境依赖包
conda activate spinningup
sudo apt-get update && sudo apt-get install libopenmpi-dev
sudo apt install git
从github把Spinning Up载到本地
git clone https://github.com/openai/spinningup.git
移动到spinningup文件夹
cd spinningup
执行安装
pip install -e .
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/
1.下载好需要的pytorch版本
pytorch各个版本的.whl文件下载地址
https://download.pytorch.org/whl/torch_stable.html
2.下载完成后,进入文件目录,进行pip安装就行了
pip install torch-1.3.1-cp36-cp36m-linux_x86_64.whl
3.安装完成后再次回到sinningup文件进行
pip install -e .
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential
sudo apt-get install -y --no-install-recommends cmake
sudo apt-get install -y --no-install-recommends libzmqpp-dev
sudo apt-get install -y --no-install-recommends libopencv-dev
conda create --name Fm python=3.6
conda activate Fm
cd ~/Desktop
git clone https://github.com/uzh-rpg/flightmare.git
echo “export FLIGHTMARE_PATH=~/Desktop/flightmare” >> ~/.bashrc
source ~/.bashrc
conda activate Fm
cd flightmare/
install tensorflow GPU (for non-gpu user, use pip install tensorflow==1.14)
pip install tensorflow-gpu==1.14
install scikit
pip install scikit-build
记得安装eigen3.3.4
cd flightmare/flightlib
it first compile the flightlib and then install it as a python package.
编译需要核数>4,内存>4G
pip install .