最近在学习《tensorflow实战》时需要下载cifar10数据集,在cifar10目录下用到命令:

import cifar10,cifar10_input
cifar10.maybe_download_and_extract()

出错,具体错误信息

UnrecognizedFlagError                     Traceback (most recent call last)
<ipython-input-2-e6d19815ade8> in <module>()
15 return var
16
---> 17 cifar10.maybe_download_and_extract()
18 images_train,labels_train = cifar10_input.disorted_inputs(data_dir=data_dir,batch_size=batch_size)
19 images_test,labels_test = cifar10_input.inputs(eval_data=True,data_dir=data_dir,batch_size=batch_size) ~/ml/models/tutorials/image/cifar10/cifar10.py in maybe_download_and_extract()
379 def maybe_download_and_extract():
380 """Download and extract the tarball from Alex's website."""
--> 381 dest_directory = FLAGS.data_dir
382 if not os.path.exists(dest_directory):
383 os.makedirs(dest_directory) ~/anaconda3/lib/python3.6/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/python3.6/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'

把这个错误信息从头到尾读了一遍,什么玩意儿??

抓耳挠腮,谷歌走一波。

完全相符的结果不多,看了上面的解决方法貌似也都不太适合我,但是从https://github.com/tensorflow/tensorflow/issues/17702,看到

也就是说他的这段出错的代码在python命令行是可以运行的。

坑爹的jupyter?

不不不,jupyter还是很方便的,jupyter牛逼!

但是怎么解决呢,继续搜索,直到大神一句话醍醐灌顶

https://github.com/jupyter/notebook/issues/3327

大神原话可能不是这个意思,但是说者无心听者有意加上我英语渣:为什么非要在jupyter上跑这行代码?就一个下载功能,直接用脚本跑呗。于是…

problem solved ^_^。

以后不要太死心眼…

初学tensorflow遇到的Error——UnrecognizedFlagError: Unknown command line flag 'f'的更多相关文章

  1. Error running 'xxx': Command line is too long. Shorten command line for xxx

    跑单元测试时,报错如下: Error running 'xxx': Command line is too long. Shorten command line for xxx 解决方案: 在项目所在 ...

  2. 运行springboot项目报错 Error running 'ResourceApplication': Command line is too long. Shorten comma

    方法1 IDEA 运行报错:Error running '***': Command line is too long 技术标签: IDEA     Error running 'Test': Com ...

  3. idea报错:Error running $classname: Command line is too long. Shorten command line for $classname.

    Command line is too long 打印的变量太长了,超过了限制,这都会报错...我只想知道idea基于什么原理会报这个错... 解决 1.按照提示修改该类的配置,选择jar manif ...

  4. idea启动springboot项目报Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter or also for Application

    解决办法:在.idea文件夹下面的workspace.xml中的 <component name="PropertiesComponent">标签下面添加: <p ...

  5. idea 启动 Error running 'XxGatewayApplication': Command line is too long. Shorten command line for XxGatewayApplication or also for Spring Boot default

    在idea workspace里 <component name="PropertiesComponent">标签下加入 <property name=" ...

  6. Error running 'App': Command line is too long. Shorten command line for App or also for Spring Boot default configuration.

    找到标签 <component name="PropertiesComponent">.在标签里加一行  : <property name="dynam ...

  7. selenium运行chrome去掉command -line flag

    每次驱动chrome浏览器都会出现这玩意,比较烦人··想办法去掉了它: ChromeOptions options = new ChromeOptions();options.addArguments ...

  8. Spring session redis ERR unknown command 'CONFIG'

    部署线上服务启动报错 redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CONFIG' Redis CON ...

  9. List of Chromium Command Line Switches(命令行开关集)——官方指定命令行更新网址

    转自:http://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which ...

随机推荐

  1. Docker进阶之四:镜像管理

      一.什么是镜像? 简单说,Docker镜像是一个不包含Linux内核而又精简的Linux操作系统. 二.镜像从哪里来? Docker Hub是由Docker公司负责维护的公共注册中心,包含大量的容 ...

  2. tomcat 控制台中文乱码问题

    1.找到${CATALINA_HOME}/conf/logging.properties2.添加语句:java.util.logging.ConsoleHandler.encoding = GBK 3 ...

  3. Android Material Design控件使用(四)——下拉刷新 SwipeRefreshLayout

    使用下拉刷新SwipeRefreshLayout 说明 SwipeRefreshLayout是Android官方的一个下拉刷新控件,一般我们使用此布局和一个RecyclerView嵌套使用 使用 xm ...

  4. 数据库学习(MySQL):JDBC的简单增删改查实现

    本文为原创,转载请注明出处: https://www.cnblogs.com/Tom-shushu/p/9171896.html 这里我们先在数据库建立一个userinfo表: CREATE TABL ...

  5. vue框架入门和ES6介绍

    vue框架入门和ES6介绍 vue-mvvm模式,vue是一种轻量级的前端框架,主要为模板渲染,数据同步,组件化,模块化,路由等. https://cn.vuejs.org/ 源码:https://g ...

  6. DevExpress TreeList 禁止节点拖动到其他节点上

    背景 在做一个类似文件树的控件,支持节点从树上向其它的控件拖动程序,但是要保证树上的节点不能拖动上其他的节点上. 代码 /// <summary> /// 拖动节点完成 /// </ ...

  7. 心路历程:当win10遇上win7激活程序...请默哀

    经历一次莫名其妙的懵逼系统崩溃后,我对破解软件/激活软件终于有了阴影,想想就想哭,不过怨不了别人,锅不能随便甩,怪自己粗心大意,怪自己太懒呜呜呜... 所以有心将这次心路历程记录下来,谨防自己下次再犯 ...

  8. robotFramework第二篇之关键字的定义和使用

    lesson.robot *** Keywords *** 打开谷歌浏览器并访问百度首页 Log 打开浏览器,输入http://www.baidu.com,进入百度首页 输入用户名 [Argument ...

  9. MYSQL如何通过一张表更新另外一张表?

    1.背景说明 很多时候我们需要通过一张中间表的数据去更新另外一张表,而不仅仅是通过固定数值去更新,尤其是当数据量很大的时候,简单的复制粘贴就不大可行了. 2.MYSQL版本 SELECT VERSIO ...

  10. linux系统mysql-5.7 修改字符集

    起因:我在网上看修改mysql字符的文章时,都说配置/etc/mysql/my.cnf文件 然而我打开我上述的my.cnf文件时,发现里面的内容跟别人的不一样,我就觉得这个肯定不是正确的文件 经过我在 ...