Tensorflow cifar10.maybe_download_and_extract()给出错误

时间:2018-04-03 14:36:56

标签: python-3.x tensorflow

我尝试使用cifar10库在tensorflow上运行CNN模型。但是,当我导入cifar10并运行maybe_download_and_extract()方法时,它会出现以下错误。我在tensorflow(1.5.0)和Python 3.6.4 :: Anaconda,Inc。

上运行它
---------------------------------------------------------------------------
UnrecognizedFlagError                     Traceback (most recent call last)
<ipython-input-37-02a754d7036a> in <module>()
----> 1 cifar10.maybe_download_and_extract()

D:\Google Drive\Akademik\Ozyegin\CS566\Project 2\cifar10.py in maybe_download_and_extract()

~\anaconda3\lib\site-packages\tensorflow\python\platform\flags.py in __getattr__(self, name)
     82     # a flag.
     83     if not wrapped.is_parsed():
---> 84       wrapped(_sys.argv)
     85     return wrapped.__getattr__(name)
     86 

~\anaconda3\lib\site-packages\absl\flags\_flagvalues.py in __call__(self, argv, known_only)
    628       suggestions = _helpers.get_flag_suggestions(name, list(self))
    629       raise _exceptions.UnrecognizedFlagError(
--> 630           name, value, suggestions=suggestions)
    631 
    632     self.mark_as_parsed()

UnrecognizedFlagError: Unknown command line flag 'f'

1 个答案:

答案 0 :(得分:2)

将以下行添加到您的jupyter笔记本中:

tf.app.flags.DEFINE_string('f', '', 'kernel')