Ubuntu 16.04 安装Tensorflow(GPU版本)--在终端运行,没有与jupyter notebook关联

  • 安装cuda
  • 安装tensorflow前提(安装编译好的版本)

配置GPU环境:

CUDA -- 10.0.130

cudnn--7.42

  • 安装bcupti-dev library可执行

sudo apt-get install libcupti-dev

  • 下面使用pip安装tensorflow

$ pip install tensorflow # Python 2.7; CPU support (no GPU support)

$ pip3 install tensorflow # Python 3.n; CPU support (no GPU support)

$ pip install tensorflow-gpu # Python 2.7; GPU support

$ pip3 install tensorflow-gpu # Python 3.n; GPU support

  • 测试是否安装成功
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> mysess = tf.Session()
>>> print(mysess.run(hello))

输出 hello,Tensorflow!

猜你喜欢

转载自blog.csdn.net/weixin_38715903/article/details/88062128