簡體   English   中英

為什么我會收到此 TensorFlow 錯誤?

[英]Why am I receiving this TensorFlow Error?

TypeError: pandas_input_fn should not be called without pandas installed

input_func = tf.compat.v1.estimator.inputs.pandas_input_fn(x=X_train,y=y_train,batch_size=10,
                                                           num_epochs=1000,shuffle=True)

我在我的環境中安裝了 pandas,因為我已經在同一個 jupyter 筆記本中使用了它。 我嘗試安裝和卸載 TensorFlow 和 Pandas 的多個版本。

有人知道是什么原因造成的嗎?

我弄清楚發生了什么事。 我的電腦出現問題,沒有將 Python 安裝到正確的 PATH 中。 Tensorflow 使用的是較舊的 Python3 版本,這導致 Tensorflow 誤解了虛擬環境中安裝了哪些模塊。

解決方案是卸載 Python 和 anaconda,重新安裝 anaconda,然后在 Z7E3332C5EFD0276 中創建一個新環境,其中包含所有內容。 然后確保環境具備一切必要條件並使用正確的 Python 版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM