CentOS7上配置与使用jupyter notebook和TensorFlow

  • CentOS7上配置与使用jupyter notebook和TensorFlow已关闭评论
  • 193 views
  • A+
所属分类:编程开发

安装Anaconda3

请查看Centos7下安装Anaconda3

添加conda源

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

添加Jupyter

conda install jupyter

配置root启动

查看jupyter 路径

jupyter notebook --generate-config --allow-root

设置密码

[root@k3s ~]# jupyter notebook password
Enter password: 
Verify password: 
[NotebookPasswordApp] Wrote hashed password to /root/.jupyter/jupyter_notebook_config.json

修改配置文件

如下:

{
 "NotebookApp": {
 "allow_root":true,
 "ip":"*",
 "port":8088,
 "notebook_dir":"/xubo/appdir",
 "password": "sha1:87ec927b3755:8835f0bc28100103e0d22087befaba37bd8550e0"
 }
}

启动

jupyter notebook

访问

浏览器输入:http://192.168.241.128:8088,然后输入密码登录进去,如下:

CentOS7上配置与使用jupyter notebook和TensorFlow

 

安装tensorflow

建立conda计算环境

命名为tensorflow,如下:

conda create -n tensorflow python=3.7

激活环境

source activate tensorflow

安装cpu版本的tensorflow

pip install --upgrade --ignore-installed tensorflow

测试

这一块输入import tensorflow as tf报错了,

问题一:如下:

ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /root/anaconda3/envs/tensorflow/lib/python3.7

解决办法:

cp /root/anaconda3/lib/libstdc++.so.6.0.25 /usr/lib64/
rm -rf /usr/lib64/libstdc++.so.6
ln -s /usr/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6

问题二:报错如下:

ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /root/anaconda3/envs/tensorflow/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

解决办法:

wget https://mirrors.sjtug.sjtu.edu.cn/gnu/libc/glibc-2.28.tar.gz
cd glibc-2.28
mkdir /opt/glibc-2.28
./configure --prefix=/opt/glibc-2.28

编译过程中如果报如下错误,继续升级make和compiler

*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

先升级make,如下:

wget ftp://ftp.gnu.org/gnu/make/make-4.2.tar.gz
tar zxvf make-4.2.tar.gz 
cd make-4.2
./configure --prefix=/usr/
make && make install

好了,到此结束

 

 

 

 

 

 

  • 安卓客户端下载
  • 微信扫一扫
  • weinxin
  • 微信公众号
  • 微信公众号扫一扫
  • weinxin
avatar