lemonamaya
2017-04-28 05:56
采纳率: 75%
浏览 6.7k

在运行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或以上。

    点赞 打赏 评论
  • silent56_th 2017-06-15 11:12

    不同版本的tensorflow差别蛮大的。所以跑公开代码的时候要仔细看好环境,尽量一样配置。

    点赞 打赏 评论

相关推荐 更多相似问题