1. 程式人生 > >TensorFlow執行錯誤,AttributeError: module 'pandas' has no attribute 'computation'

TensorFlow執行錯誤,AttributeError: module 'pandas' has no attribute 'computation'

TensorFlow執行錯誤,AttributeError: module ‘pandas’ has no attribute ‘computation’

在我今天剛開始使用TensorFlow做數字識別時,在匯入input_data方法時,即是執行“from tensorflow.examples.tutorials.mnist import input_data”時,遇到了pandas的一個錯誤,錯誤提示如下:

AttributeError: module ‘pandas’ has no attribute ‘computation’

該問題的原因是pandas中沒有computation這個屬性,可能是在pandas-0.20.2

裡沒有這個屬性吧,所以需要把pandas的版本換為老版本的(此處以換為pandas-0.19.2為例),而對於此問題的解決步驟如下:

2、我是下載到了“ D:\360安全瀏覽器下載\”的資料夾下,然後在cmd命令視窗中輸入以下命令:
pip install 下載的pandas檔案位置
例如:pip install D:\360安全瀏覽器下載\pandas-0.19.2-cp35-cp35m-win_amd64.whl

4、如果出現第3步的問題,也可以不設定環境變數,只不過會麻煩點,需要在pip的資料夾開啟(比如Anaconda3\Scripts \或者Python\Python35\Scripts\)cmd命令視窗

(即是在位址列輸入cmd),然後再進行第2步。

以上就可以解決這個錯誤了。