lemonamaya 2017-04-28 05:56 采纳率: 75%
浏览 6847
已采纳

在运行tensorflow MNIST 里的例子时报错

/tensorflow-master/tensorflow/examples/tutorials/mnist$ python fully_connected_feed.py
/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "fully_connected_feed.py", line 277, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'
我是从GITHUB上下载的包,代码也没改,运行的fully_connceted_feed.py时报错

  • 写回答

2条回答 默认 最新

  • Daniel2333 2017-05-10 04:01
    关注

    主要线索是错误提示:

    TypeError: run() got an unexpected keyword argument 'argv'

    目测应该是你的tensorflow版本问题。
    r0.11及以前的版本里, tf.app.run

     def run(main=None):
      f = flags.FLAGS
      flags_passthrough = f._parse_flags()
      main = main or sys.modules['__main__'].main
      sys.exit(main(sys.argv[:1] + flags_passthrough))
    

    没有argv参数,argv参数是r0.12后加入。
    所以,推测你的tensorflow版本在r0.11及以下,你需要更新你的tensorflow版本到r0.12或以上。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?