成功地從源代碼構建TensorFlow之後,第一試驗例通過,而第二個失敗:成功構建TensorFlow;例如失敗
1)第一測試:OK
$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
2)第二測試:失敗
測試文件:tensorflow /型號/圖片/ MNIST/convolutional.py
$ sudo python convolutional.py
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so.8.0 locally
Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
Traceback (most recent call last):
File "convolutional.py", line 339, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "convolutional.py", line 231, in main
logits, train_labels_node))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1684, in sparse_softmax_cross_entropy_with_logits
labels, logits)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1533, in _ensure_xent_args
"named arguments (labels=..., logits=..., ...)" % name)
ValueError: Only call `sparse_softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)
由於convolutional.py
是安裝指南中報告的測試之一,我會實驗值等它很好。
我跑項目目錄中的所有測試,而這些都是結果:
- MNIST:失敗
- AlexNet:通過
- Cifar10:失敗
- ImageNet:通過
我可以在構建中做任何錯誤,或者我在運行這些測試時做了什麼錯誤?
參考:https://www.tensorflow.org/get_started/os_setup
平臺:Linux/Ubuntu 16.04,nVidia Quadro M6000,啓用CUDA。
我認爲這個問題是SO的話題。如果有任何「問題」...... – Taro
@Taro:我提出了更明確的問題。 – Pietro
我的理解是,您的問題是特定於Tensorflow,而不是您製作的某些軟件。再說一遍,我認爲這是脫離主題,你可能想嘗試任何Tensorflow相關的文檔/論壇。 – Taro