2016-12-16 1 views
2

Ich konnte Tensorflow installieren und führen Sie das Convolutional.py Beispiel. jedoch, wenn ich gehen, um das Beispiel Wide and Deep net tutorial, iTensorflow nicht weit und tief Netzwerk-Tutorial

% python wide_deep_tutorial.py                             
    Training data is downloaded to /tmp/tmpr3k3fwnc 
    Test data is downloaded to /tmp/tmpzxhrdh00 
    model directory = /tmp/tmpg_s1yutm 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "sum" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:The default value of combiner will change from "mean" to "sqrtn" after 2016/11/01. 
    WARNING:tensorflow:From /home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py:711 in fit.: calling BaseEstimator.fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with x is deprecated and will be removed after 2016-12-01. 
    Instructions for updating: 
    Estimator is decoupled from Scikit Learn interface by moving into 
    separate class SKCompat. Arguments x, y and batch_size are only 
    available in the SKCompat class, Estimator will only accept input_fn. 
    Example conversion: 
     est = Estimator(...) -> est = SKCompat(Estimator(...)) 
    WARNING:tensorflow:From /home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py:711 in fit.: calling BaseEstimator.fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with y is deprecated and will be removed after 2016-12-01. 
    Instructions for updating: 
    Estimator is decoupled from Scikit Learn interface by moving into 
    separate class SKCompat. Arguments x, y and batch_size are only 
    available in the SKCompat class, Estimator will only accept input_fn. 
    Example conversion: 
     est = Estimator(...) -> est = SKCompat(Estimator(...)) 
    WARNING:tensorflow:From /home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py:711 in fit.: calling BaseEstimator.fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with batch_size is deprecated and will be removed after 2016-12-01. 
    Instructions for updating: 
    Estimator is decoupled from Scikit Learn interface by moving into 
    separate class SKCompat. Arguments x, y and batch_size are only 
    available in the SKCompat class, Estimator will only accept input_fn. 
    Example conversion: 
     est = Estimator(...) -> est = SKCompat(Estimator(...)) 
    Traceback (most recent call last): 
     File "wide_deep_tutorial.py", line 208, in <module> 
     tf.app.run() 
     File "/home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 43, in run 
     sys.exit(main(sys.argv[:1] + flags_passthrough)) 
     File "wide_deep_tutorial.py", line 204, in main 
     train_and_eval() 
     File "wide_deep_tutorial.py", line 197, in train_and_eval 
     m.fit(input_fn=lambda: input_fn(df_train), steps=FLAGS.train_steps) 
     File "/home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 711, in fit 
     max_steps=max_steps) 
     File "/home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 191, in new_func 
     return func(*args, **kwargs) 
     File "/home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 355, in fit 
     max_steps=max_steps) 
     File "/home/eliethesaiyan/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 690, in _train_model 
     features, labels = input_fn() 
     File "wide_deep_tutorial.py", line 197, in <lambda> 
     m.fit(input_fn=lambda: input_fn(df_train), steps=FLAGS.train_steps) 
     File "wide_deep_tutorial.py", line 159, in input_fn 
     for k in CATEGORICAL_COLUMNS} 
     File "wide_deep_tutorial.py", line 159, in <dictcomp> 
     for k in CATEGORICAL_COLUMNS} 
    TypeError: __init__() got an unexpected keyword argument 'dense_shape' 

Die Ausgabe erhalten den folgenden Fehler zu führen, die in einer similar Frage aufgeworfen wurden, schlug einige protobuf deinstallieren und installieren Sie es nach tensorflow installieren, aber es hat nicht Hilfe in meinem Fall würde ich sehr schätzen, wenn jemand helfen könnte.

+1

Versuchen Sie, 'dense_shape' durch' shape' zu ​​ersetzen. Ich denke, dass es in einer zukünftigen Version der API '' dichte_form '' genannt wird. – kempy

+0

Es hat funktioniert, ich denke, wenn ich dichte_shape verwenden sollte, hätte ich direkt von github auschecken sollen – Eliethesaiyan

Antwort

5

TL; DR: Stellen Sie sicher, dass die Version wide_n_deep_tutorial.py ausgeführt wird, die der installierten Version von TensorFlow entspricht. Zum Beispiel können Sie die version from the r0.12 branch herunterladen, wenn Sie TensorFlow 0.12 installiert haben.

Die Datei wide_n_deep_tutorial.py war recently changed im Master-Zweig der TensorFlow, eine Änderung in der API zu reflektieren (wie kempy points out in ihrem Kommentar wird tf.SparseTensor.shapetf.SparseTensor.dense_shape im nächsten Release zu werden).

+0

Sie sind richtig, es war Version Problem, ich werde die nächste Version aufpassen – Eliethesaiyan