美文网首页
ubuntu 18.04 深度学习环境搭建

ubuntu 18.04 深度学习环境搭建

作者: ttlidx | 来源:发表于2019-07-15 11:38 被阅读0次

下载openssh-server

sudo apt-get install openssh-server

镜像修改

sudo cp /etc/apt/sources.list   /etc/apt/sources.list.bak

sudo vim /etc/apt/sources.list

把最后一段改成:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

#deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

#deb-src 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-backports main restricted universe multiverse

更新

sudo apt-get update

sudo apt-get upgrade

安装pip

sudo apt-get install python3-pip

sudo pip3 install --upgrade pip

修改pip源

sudo  vim ~/.pip/pip.conf

#ali的pip.conf配置

[global]

index-url = http://mirrors.aliyun.com/pypi/simple

[install]

trusted-host = mirrors.aliyun.com

安装jupyter

sudo apt-get install jupyter

pip3 install jupyter

jupyter notebook --generate-config

jupyter notebook password

jupyter notebook --ip 0.0.0.0

安装anaconda

wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh

bash ~/anaconda3/Anaconda3-5.1.0-Linux-x86_64.sh

source /home/keras/.bashrc

conda 修改国内源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes

jupyter远程登陆设置

jupyter notebook --generate-config

jupyter-notebook password

vim ~/.jupyter/jupyter_notebook_config.py

c.NotebookApp.ip='*'

conda 创建环境

conda create -n dl python=3.6

source activate dl

安装tensorflow

conda create --name tensorflow python=3.5 jupyter

source activate tensorflow

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp35-cp35m-linux_x86_64.whl

验证tensorflow

vim test.py

# Python

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')

sess = tf.Session()

print(sess.run(hello))

python test.py

安装keras

pip install keras

安装pytorch-cpu

conda install pytorch -c soumith

相关文章

网友评论

      本文标题:ubuntu 18.04 深度学习环境搭建

      本文链接:https://www.haomeiwen.com/subject/amtxtqtx.html