Tensorflow安裝教程

2021-10-23 22:04:00 字數 1016 閱讀 3355

⦁ 按圖所示操作

⦁ 在cmd控制台視窗中鍵入pip list

⦁ 輸入pip uninstall tensorflow後將解除安裝掉tensorflow

⦁ 再cmd控制台視窗中鍵入如下圖所示命令

⦁ 安裝後再在cmd控制台視窗下鍵入python進入python環境

⦁ 輸入下面**後出錯

import tensorflow as tf

hello = tf.constant(『hello,tensorf』)

sess = tf.session()

print(sess.run(hello))

⦁ 出現錯誤attributeerror: module 『tensorflow』 has no attribute 『session』

⦁ sess=tf.session()更正為:

⦁sess=tf.compat.v1.session(config=tf.compat.v1.configproto(log_device_placement=true))

⦁ 再次出現錯誤:

⦁ 把上述**為下述**後成功輸出:

import tensorflow as tf

hello=tf.constant(『hello world』)

print(hello)

print(hello.numpy())

17.pip install –upgrade tensorflow==1.0

安裝TensorFlow教程

1.安裝anaconda 2.建立乙個conda環境,命名為tensorflow conda create n tensorflow3.用以下命令進入conda環境 source activate tensorflow tensorflow 進入tensorflow後的顯示符4.安裝tensorfl...

tensorflow安裝教程

conda config add channels conda config add channels conda config add channels conda config add channels conda config set show channel urls yes 從 c use...

Tensorflow2 2 0 cpu安裝教程

這個過程僅需要兩步 1.公升級pip版本,輸入命令 python m pip install upgrade pip 注 本人使用過程中,特別慢導致最後出現 time out 的超時錯誤,故在後面新增了豆瓣源,可以加快公升級速度 建議使用如下命令 python m pip install upgra...