【err】tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue
problem
Traceback (most recent call last):
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _do_call
return fn(*args)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_0_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested , current size )
[[{{node shuffle_batch}}]] During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "test_TFRecord.py", line , in <module>
print(sess.run(label_batch))
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in run
run_metadata_ptr)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _run
feed_dict_tensor, options, run_metadata)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _do_run
run_metadata)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/client/session.py", line , in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_0_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested , current size )
[[node shuffle_batch (defined at test_TFRecord.py:) ]] Original stack trace for 'shuffle_batch':
File "test_TFRecord.py", line , in <module>
num_threads=)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line , in new_func
return func(*args, **kwargs)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/training/input.py", line , in shuffle_batch
name=name)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/training/input.py", line , in _shuffle_batch
dequeued = queue.dequeue_many(batch_size, name=name)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/ops/data_flow_ops.py", line , in dequeue_many
self._queue_ref, n=n, component_types=self._dtypes, name=name)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line , in queue_dequeue_many_v2
timeout_ms=timeout_ms, name=name)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line , in _apply_op_helper
op_def=op_def)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line , in new_func
return func(*args, **kwargs)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line , in create_op
op_def=op_def)
File "/home/xxx/anaconda3/envs/mtcnn_tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line , in __init__
self._traceback = tf_stack.extract_stack()
code
# -*- coding: utf-8 -*-
"""
@author: friedhelm """
import tensorflow as tf
img_size = 12
filename_queue = tf.train.string_input_producer(["/home/xxx/workspace/test_code/github_test/MTCNN-tensorflow/version_1_0/DATA/12/neg_12_train.tfrecords"],shuffle=True,num_epochs=10) reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue) #返回文件名和文件 features = tf.parse_single_example(serialized_example,
features={
'img':tf.FixedLenFeature([],tf.string),
'label':tf.FixedLenFeature([],tf.int64),
'roi':tf.FixedLenFeature([4],tf.float32),
'landmark':tf.FixedLenFeature([10],tf.float32),
})
img=tf.decode_raw(features['img'],tf.uint8)
label=tf.cast(features['label'],tf.int64)
roi=tf.cast(features['roi'],tf.float32)
landmark=tf.cast(features['landmark'],tf.float32)
# img = tf.reshape(img, [48,48,3])
img = tf.reshape(img, [img_size,img_size,3])
# img=img_preprocess(img)
min_after_dequeue = 1000 #
batch_size = 10 #
capacity = min_after_dequeue + 10 * batch_size
image_batch, label_batch, roi_batch, landmark_batch = tf.train.shuffle_batch([img,label,roi,landmark],
batch_size=batch_size,
capacity=capacity,
min_after_dequeue=min_after_dequeue,
num_threads=7) i=0
with tf.Session() as sess:
sess.run((tf.global_variables_initializer(),
tf.local_variables_initializer()))
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess=sess,coord=coord)
while(1):
i=i+1
if(i%9==1):
print(sess.run(label_batch))
why?
解决方法:详见here;
完
【err】tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue的更多相关文章
- tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue 原创文章,请勿转载哦~!! 觉得有用的话,欢迎一起讨论相互学习~F ...
- Tensorflow 报错:tensorflow.python.framework.errors_impl.InternalError: Failed to create session.
问题描述 IDE:pycharm,环境中安装tensorflow-gpu 1.8.0 ,Cuda9 ,cudnn 7,等,运行代码 报错如下 tensorflow.python.framework.e ...
- faster-rcnn错误信息 : tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [21] rhs shape= [2]
faster-rcnn错误信息 : tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shap ...
- tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'x_1' with dtype float and shape [?,227,227,3]
记一次超级蠢超级折磨我的bug. 报错内容: tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a ...
- 【译】TensorFlow Python Docs 之 overview
Overview 综述 TensorFlow has APIs available in several languages both for constructing and executing a ...
- ''tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[?]'' 错误分析
这是tensorflow 一个经常性错误,错误的原因在于:显卡内存不够. 解决方法就是降低显卡的使用内存,途径有以下几种措施: 1 减少Batch 的大小 2 分析错误的位置,在哪一层出现显卡不够,比 ...
- tensorflow.python.framework.errors_impl.PermissionDeniedError: /data; Permission denied
在linux系统中,tensorflow跑mnist数据集出现错误,本应该自动下载的数据集 将mnist自动下载的路径,由/data/mnist之前的/删掉即可.改为data/mnist.
- 【6】TensorFlow光速入门-python模型转换为tfjs模型并使用
本文地址:https://www.cnblogs.com/tujia/p/13862365.html 系列文章: [0]TensorFlow光速入门-序 [1]TensorFlow光速入门-tenso ...
- 【0】TensorFlow光速入门-序
本文地址:https://www.cnblogs.com/tujia/p/13863181.html 序言: 对于我这么一个技术渣渣来说,想学习TensorFlow机器学习,实在是太难了: 百度&qu ...
随机推荐
- hadoop分布式集群环境搭建
参考 http://www.cnblogs.com/zhijianliutang/p/5736103.html 1 wget http://mirrors.shu.edu.cn/apache/hado ...
- http请求头出现provisional headers are shown
http请求头出现provisional headers are shown Provisional headers are shown provisional 详细用法>> 英 [prə ...
- web自动化测试-selenium多表单切换
一.概述 1.在web应用中会经常遇到frame/iframe表单嵌套页面的应用 2.WebDriver只能在一个页面上对元素进行识别与定位 3.对于frame/iframe表单内嵌的页面上元素无法识 ...
- 3.Vue 实例
创建一个 Vue 实例 每个 Vue 应用都是通过用 Vue 函数创建一个新的 Vue 实例开始的: var vm = new Vue({ // 选项 }) 虽然没有完全遵循 MVVM 模型,但是 V ...
- pass的作用?
1.空语句 do nothing 2.保证格式完整,保证语义完整 3.占位语句
- HDU - 5513 Efficient Tree(轮廓线DP)
前言 最近学了基于连通性的状压DP,也就是插头DP,写了几道题,发现这DP实质上就是状压+分类讨论,轮廓线什么的也特别的神奇.下面这题把我WA到死- HDU-5531 Efficient Tree 给 ...
- B/S开发——文件夹的上传和下载
本人在2010年时使用swfupload为核心进行文件的批量上传的解决方案.见文章:WEB版一次选择多个文件进行批量上传(swfupload)的解决方案. 本人在2013年时使用plupload为核心 ...
- php之大文件分段上传、断点续传
前段时间做视频上传业务,通过网页上传视频到服务器. 视频大小 小则几十M,大则 1G+,以一般的HTTP请求发送数据的方式的话,会遇到的问题:1,文件过大,超出服务端的请求大小限制:2,请求时间过长, ...
- circus docker image web 运行异常问题的解决
经过查看官方文档,因为我使用的是python 较高版本,存在兼容问题,解决方法 修改基础镜像版本 代码如下: FROM python:2.7-slim-stretch LABEL AUTHOR=&qu ...
- 1-ESP8266 SDK开发基础入门篇--开发环境搭建
因为今天终于做好了自己的另一块工控板,所以我就开始写基础公开篇的内容,希望自己小小的努力能够帮到大家 自己做的另一块板子 https://www.cnblogs.com/yangfengwu/cate ...