Tensorflow:fully_connected_feed.py运行报错

机器学习 899 浏览

Traceback (most recent call last): File “fully_connected_feed.py”, line 279, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) TypeError: run() got an unexpected keyword argument ‘argv’ 报错如上。 以上报错原因是Tensorflow版本过低(版本为0.8),建议升级到0.12.1

查看Tensorflow版本方法:

z790704069@ubuntu:/$ python
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> tensorflow.__version__
'0.8.0'
>>> 

升级到0.12.1:

z790704069@ubuntu:/$ sudo pip install tensorflow-0.12.1-cp27-none-linux_x86_64.whl
如果多次安装不成功可以将whl文件下到本地安装
z790704069@ubuntu:/opt$ sudo pip install tensorflow-0.12.1-cp27-none-linux_x86_64.whl
z790704069@ubuntu:/$ python
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> tensorflow.__version__
'0.12.1'
>>> 
python fully_connected_feed.py

关注微信公众号 "Kooola大数据" :) 聊人生 | 聊技术