在阿里云上部署Tensorflow和Jupyter

目的

    1、搭建Tensorflow环境;

    2、使用Jupyter进行开发;

    3、代码上传github


成果

    1、在阿里云上租用Linux服务器;

    2、搭建python、tensorflow开发环境

    3、搭建外网访问jupyter环境

    4、代码上传github


过程

一、租用阿里云服务器

    镜像选择的是一款python3的环境

二、利用putty登录云服务器

    查看python版本(ls /usr/bin/ |grep python):有2个版本的python,分别是2.7和3.6

    查看pip版本(pip -V):python3.6的pip

三、安装tensorflow

    原打算通过anaconda安装tensorflow,但是安装后在jupyter中无法引入tensorflow,在网上寻找解决办法,有说路径问题的,有说在tensorflow环境中再安装一套jupyter的,但尝试无果,所以决定采取简单粗暴的方式,pip安装一切(tensorflow、jupyter、pandas、matplotlib)

    pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.8.0rc0-cp36-cp36m-linux_x86_64.whl

    其他版本可以访问https://storage.googleapis.com/tensorflow

    验证安装,进入python,import tensorflow

四、安装jupyter

    pip install jupyter

    参考阿里云ECS搭建Jupyter Notebook - CSDN博客配置jupyter,配置putty,启动chrome浏览器访问jupyter

    测试,在jupyter新建python3文档,import numpy;import tensorflow;

五,代码上传github

    安装git(yum install git-core)

    配置git(git config --global user.name xxx  ;  git config --global user.email xxx)

    参考运行git push时出错,提示Permission denied (publickey) - CSDN博客与github账号建立密钥对

    克隆github仓库(git clone [email protected]:xxx)

你可能感兴趣的:(在阿里云上部署Tensorflow和Jupyter)