簡體   English   中英

模塊“tensorflow.tools.docs.doc_controls”沒有屬性“inheritable_header”

[英]Module 'tensorflow.tools.docs.doc_controls' has no attribute 'inheritable_header'

今天從 tensorflow 運行估計器並想出了這個錯誤,知道如何解決嗎?

File "C:\Users\ASUS Laptop\anaconda3\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 70, in <module>
    @doc_controls.inheritable_header("""\
AttributeError: module 'tensorflow.tools.docs.doc_controls' has no attribute 'inheritable_header'

這是在我的 estimator.py 文件中:@doc_controls.inheritable_header("""
警告:不建議將估算器用於新代碼。 估算器運行v1.Session樣式的代碼,該代碼更難正確編寫,並且可能出現意外行為,尤其是與 TF 2 代碼結合使用時。 估算器確實屬於我們的兼容性保證,但除了安全漏洞之外不會收到任何修復。 有關詳細信息,請參閱遷移指南 """)

檢查您的“tensorflow-estimator”版本,似乎 10 月 30 日的 2.7 版本與某些庫不兼容

嘗試 2.6 版:

pip install --upgrade tensorflow-estimator==2.6.0

升級或降級 tensorflow-estimator 包以匹配 tensorflow 版本。

當我輸入下面的代碼時,我遇到了同樣的問題,我收到了這個錯誤:

AttributeError:模塊“tensorflow.tools.docs.doc_controls”沒有屬性“doc_private”

代碼是:#模塊

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from keras.wrappers.scikit_learn import KerasClassifier
from keras.utils import np_utils

import tensorflow as tf

# for modeling
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.callbacks import EarlyStopping

暫無
暫無

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

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