最近在学习《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. Wolsey“强整数规划模型”经典案例之一单源固定费用网络流问题

    Wolsey“强整数规划模型”经典案例之一单源固定费用网络流问题 阅读本文可以理解什么是“强”整数规划模型. 单源固定费用网络流问题见文献[1]第13.4.1节(p229-231),是"强整 ...

  2. java并发多线程显式锁Condition条件简介分析与监视器 多线程下篇(四)

    Lock接口提供了方法Condition newCondition();用于获取对应锁的条件,可以在这个条件对象上调用监视器方法 可以理解为,原本借助于synchronized关键字以及锁对象,配备了 ...

  3. SLAM+语音机器人DIY系列:(三)感知与大脑——1.ydlidar-x4激光雷达

    摘要 在我的想象中机器人首先应该能自由的走来走去,然后应该能流利的与主人对话.朝着这个理想,我准备设计一个能自由行走,并且可以与人语音对话的机器人.实现的关键是让机器人能通过传感器感知周围环境,并通过 ...

  4. Springboot 系列(八)动态Banner与图片转字符图案的手动实现

    使用过 Springboot 的对上面这个图案肯定不会陌生,Springboot 启动的同时会打印上面的图案,并带有版本号.查看官方文档可以找到关于 banner 的描述 The banner tha ...

  5. 基于ElasticStack数据分析应用系统

    1.Elasticsearch Elasticsearch 基于java,是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格接口,多数据源,自 ...

  6. CVE-2017-1000405 利用脏牛漏洞Linux提权复现

    当前路径: /var/www 磁盘列表: / 系统信息: Linux zico 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 ...

  7. Java自增和自减操作符——++/--的那些事

    1. 概述 自增操作符(++)和自减操作符(--)是对变量进行加1和减1的操作. 2.分类说明 ++和--是对变量进行自增1和自减1的简写操作符.许多编程任务中经常需要对变量加1或者减1,所以采用这两 ...

  8. Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll

    Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll 在使用Anaconda创建一个虚拟环境出来,然后安装了scikit-learn.nump ...

  9. Python数据处理与计算——概述

    Python是一种面向对象的,动态的程序设计语言,具有非常简洁而清晰的语法,适合于完成各种高层任务.它既可以用来快速开发程序脚本,也可以用来开发大规模的软件. 随着NumPy.SciPy.Matplo ...

  10. 生鲜配送管理系统_升鲜宝供应链系统V2.0 设计思想及主要模块,欢迎大家批评指点。

    前言: 经过这几年的开发,升鲜宝生鲜供应链系统管理软件,终于完成C/S与B/S二个版本的开发,先主要介绍B/S版本的功能,C/S版本的功能更加完善. 升鲜宝供应链系统主要由以下几个主要端组成:     ...