初学tensorflow遇到的Error——UnrecognizedFlagError: Unknown command line flag 'f'
最近在学习《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'的更多相关文章
- 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 解决方案: 在项目所在 ...
- 运行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 ...
- idea报错:Error running $classname: Command line is too long. Shorten command line for $classname.
Command line is too long 打印的变量太长了,超过了限制,这都会报错...我只想知道idea基于什么原理会报这个错... 解决 1.按照提示修改该类的配置,选择jar manif ...
- 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 ...
- 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=" ...
- 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 ...
- selenium运行chrome去掉command -line flag
每次驱动chrome浏览器都会出现这玩意,比较烦人··想办法去掉了它: ChromeOptions options = new ChromeOptions();options.addArguments ...
- Spring session redis ERR unknown command 'CONFIG'
部署线上服务启动报错 redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CONFIG' Redis CON ...
- List of Chromium Command Line Switches(命令行开关集)——官方指定命令行更新网址
转自:http://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which ...
随机推荐
- SLAM+语音机器人DIY系列:(一)Linux基础——2.安装Linux发行版ubuntu系统
摘要 由于机器人SLAM.自动导航.语音交互这一系列算法都在机器人操作系统ROS中有很好的支持,所以后续的章节中都会使用ROS来组织构建代码:而ROS又是安装在Linux发行版ubuntu系统之上的, ...
- 玩转Spring Cloud之配置中心(config server &config client)
本文内容导航: 一.搭建配置服务中心(config server) 1.1.git方式 1.2.svn方式 1.3.本地文件方式 1.4.解决配置中包含中文内容返回乱码问题 二.搭建配置消费客户端( ...
- leetcode 链表类型题目解题总结
最基础的方式要做到非常熟练,要熟练到不思考就能写,但又需明白各处的要求和陷阱 合并两个有序链表的操作,在前面加上一个初始节点,注意while循环和退出时的处理,理解如何处理其中一个链表遍历完的情况 L ...
- 【Oracle学习笔记】游标
1. 分类 常见的游标可分为显示游标.隐式游标.静态游标和动态游标四大类: 1.1 显示游标 显式是相对与隐式cursor而言的,就是有一个明确的声明的cursor.显式游标的声明类似如下: delc ...
- Java基础差,需要怎么补
本文首发于本博客 猫叔的博客,转载请申明出处 感谢sugar的提问:Java基础差,需要怎么补? 欢迎关注公众号:Java猫说 我整体的总结了一下,大致分为以下的几个点说一下: 1.善于使用搜索引擎 ...
- 第三章:shiro授权认证
授权:也叫访问控制,即在应用中控制谁能访问哪些资源(如访问页面/编辑数据/页面操作等). 主体:即访问应用的用户,在Shiro中使用Subject代表该用户.用户只有授权后才允许访问相应的资源. 资源 ...
- webpack使用exclude
在进行项目打包的时候,当使用babel-loader进行js兼容时,不需要将node_modules模块下的所有js文件进行打包.
- 可编辑且宽度自适应input
默认的input项是比较难看的,并且它的宽度还无法随着输入而变化,这样未免有些呆板,不过借助JavaScript可以达到宽度自适应的效果,下面为了方便使用了jQuery: <div class= ...
- FreeNas搭建踩坑指南(二)
0x00 权限配置 FreeNas完成后配置用户组及权限,新建用户和用户组后添加Samba共享(Windows模式),无法准确控制权限,尝试在系统中修改权限提示"Operation not ...
- DVWA 黑客攻防实战(十五) 绕过内容安全策略 Content Security Policy (CSP) Bypass
看到标题,是否有点疑惑 CPS 是什么东东.简单介绍一下就是浏览器的安全策略,如果 标签,或者是服务器中返回 HTTP 头中有 Content-Security-Policy 标签 ,浏览器会根据标签 ...