我試圖運行tensorflow示例。TensorFlow r0.11給出TypeError:run()得到了一個意外的關鍵字參數'argv'
這裏是我的設置:
的Ubuntu 16.04
CUDA-回購ubuntu1604-8-0-local_8.0.44-1_amd64.deb
cudnn-8.0-Linux的x64的V5。 0-ga.tgz
https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp35-cp35m-linux_x86_64.whl
我試圖運行這樣的:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))
我看到這一點:
[email protected]:~/tf11 $
[email protected]:~/tf11 $ python tf10.py
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties:
name: GeForce 940MX
major: 5 minor: 0 memoryClockRate (GHz) 1.2415
pciBusID 0000:01:00.0
Total memory: 3.95GiB
Free memory: 3.50GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0)
b'Hello, TensorFlow!'
42
[email protected]:~/tf11 $
[email protected]:~/tf11 $
[email protected]:~/tf11 $
我試圖運行這樣的:
我看到這一點:
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $ python mnist_with_summaries.py
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "mnist_with_summaries.py", line 205, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $
[email protected]:~/tensorflow/tensorflow/examples/tutorials/mnist $
我歡迎任何有關如何調試的想法。
你能刪除',argv = [sys.argv [0]] + unparsed'部分嗎?無論如何,'main'並沒有使用它們。 – sygi