初始化
安装图形界面
yum groupinstall "X Window System"
yum groupinstall "Gnome"
安装火狐浏览器
yum -y install firefox
yum -y groupinstall Fonts
中文输入法不能用
yum install ibus-libpinyin
卸载原有cuda(run 版本)
在cuda10.1目录下 bin文件夹找到
sudo ./cuda-uninstaller
或者
sudo ./uninstall_cuda_toolkit_7.0.pl
安装numpy,matplotlib
开机
默认进入字符界面,输入用户名和密码后,输入
init 5
不行的话,试一下
startx
进入图形界面
安装GCC
yum -y install gcc
安装numpy
# pip3 install numpy
- 更新pip(后面也会提醒)
# pip3 install --upgrade pip
测试numpy
# python3
>>>import numpy as np
>>> a = np.array([1,2])
>>> a
array([1, 2])
安装matplotlib
# pip3 install matplotlib
测试
#python3
>>> import matplotlib.pyplot as plt
>>> flg = plt.figure()
>>> plt.show()
安装anaconda
anaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。
[root@ecs-bd12 ~]# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.0-Linux-x86_64.sh
更新:发现上面的5.3.0版本有问题,安装后,第二次打开,不能使用conda下载其他包,卸载后,安装旧版
安装anaconda3
安装步骤参考
# bash Anaconda3-5.3.0-Linux-x86_64.sh
# source /root/.bashrc
# conda --version
安装tensorflow
安装 jupyter
安装好tensorflow,为了能在jupyter下使用tf,
(tensorflow) [root@ecs-bd12 ~]# conda install ipython
(tensorflow) [root@ecs-bd12 ~]# conda install jupyter
注意,这两步是在
source activate tensorflow
启动了tensorfow之后,再运行
安装pycharm2018
pycharm下tf跑 mnist数据集
由于
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
在线一直下载不下来,可以自行mnist数据集下载,放在MNIST_data/文件夹下
代码参考
由于会出现警告,加入
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
jupyter tf跑mnist
先激活tensorflow环境
source activate tensorflow
如需关闭则source deactivate tensorflow
然后输入
(tensorflow) [root@ecs-bd12 ~]# jupyter notebook
则会打开一个jupyter网页,即可