TensorFlow:添加TensorFlow调试器后队列崩溃

TensorFlow:添加TensorFlow调试器后队列崩溃,tensorflow,Tensorflow,我正在运行我的代码onTensorFlow,我得到了损失的stange值。 现在我想使用TensorFlow调试器来调试数据,但当我在代码中添加调试器时,如下所示 sess=tfdbg.LocalCLIDebugWrapperSession(sess,thread_name_filter="MainThread$") sess.add_tensor_filter("has_inf_or_nan",tfdbg.has_inf_or_nan) 由于队列中没有任何元素,并且带有以下错误信息,所以它刚

我正在运行我的代码onTensorFlow,我得到了损失的stange值。 现在我想使用TensorFlow调试器来调试数据,但当我在代码中添加调试器时,如下所示

sess=tfdbg.LocalCLIDebugWrapperSession(sess,thread_name_filter="MainThread$")
sess.add_tensor_filter("has_inf_or_nan",tfdbg.has_inf_or_nan)
由于队列中没有任何元素,并且带有以下错误信息,所以它刚刚兑现:

index_epoch FIFOQueue '_0_index' is closed and has insufficient elements (requested 128000, current size 0)
         [[Node: index_dequeue = QueueDequeueManyV2[component_types=[DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](index, index_dequeue/n)]]


Caused by op 'index_dequeue', defined at:
  File "main3.py", line 120, in <module>
    tf.app.run()
  File "C:\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main3.py", line 99, in main
    data_file=FLAGS.imglist_file)
  File "D:\workspace\tensorflow-101.git\CAN\trunk\model3.py", line 90, in __init__
    self.build_model()
  File "D:\workspace\tensorflow-101.git\CAN\trunk\model3.py", line 106, in build_model
    'index_dequeue') 
  File "C:\Python35\lib\site-packages\tensorflow\python\ops\data_flow_ops.py", line 457, in dequeue_many
    self._queue_ref, n=n, component_types=self._dtypes, name=name)
  File "C:\Python35\lib\site-packages\tensorflow\python\ops\gen_data_flow_ops.py", line 946, in _queue_dequeue_many_v2
    timeout_ms=timeout_ms, name=name)
  File "C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 2506, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 1269, in __init__
    self._traceback = _extract_stack()

OutOfRangeError (see above for traceback): FIFOQueue '_0_index' is closed and has insufficient elements (requested 128000, current size 0)
         [[Node: index_dequeue = QueueDequeueManyV2[component_types=[DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](index, index_dequeue/n)]]

Traceback (most recent call last):
  File "main3.py", line 120, in <module>
    tf.app.run()
  File "C:\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main3.py", line 103, in main
    can.train(FLAGS)
  File "D:\workspace\tensorflow-101.git\CAN\trunk\model3.py", line 273, in train
    label_epoch = np.array(self.label_list)[index_epoch] 
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
index\u epoch FIFOQueue'\u 0\u index'已关闭且元素不足(请求128000,当前大小为0)
[[Node:index_dequeue=QueueDequeueManyV2[组件类型=[DT_INT32],超时时间=-1,_device=“/job:localhost/replica:0/task:0/cpu:0”](索引,index_dequeue/n)]]
由op“索引退出”引起,定义于:
文件“main3.py”,第120行,在
tf.app.run()
文件“C:\Python35\lib\site packages\tensorflow\python\platform\app.py”,第48行,正在运行
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“main3.py”,第99行,在main中
数据文件=FLAGS.imglist文件)
文件“D:\workspace\tensorflow-101.git\CAN\trunk\model3.py”,第90行,在\uuu init中__
self.build_model()
文件“D:\workspace\tensorflow-101.git\CAN\trunk\model3.py”,第106行,内建模型
"索引(出列))
文件“C:\Python35\lib\site packages\tensorflow\python\ops\data\u flow\u ops.py”,第457行,在队列中
self.\u queue\u ref,n=n,component\u types=self.\u dtypes,name=name)
文件“C:\Python35\lib\site packages\tensorflow\python\ops\gen\u data\u flow\u ops.py”,第946行,在队列中
超时时间=超时时间,名称=名称)
文件“C:\Python35\lib\site packages\tensorflow\python\framework\op_def_library.py”,第767行,在apply_op中
op_def=op_def)
文件“C:\Python35\lib\site packages\tensorflow\python\framework\ops.py”,第2506行,在create\u op中
初始值=自身值。\默认值\初始值,初始值=初始值)
文件“C:\Python35\lib\site packages\tensorflow\python\framework\ops.py”,第1269行,在\uuu init中__
self.\u traceback=\u extract\u stack()
OutOfRangeError(回溯见上文):FIFOQUUE“\u 0\u索引”已关闭且元素不足(请求128000,当前大小为0)
[[Node:index_dequeue=QueueDequeueManyV2[组件类型=[DT_INT32],超时时间=-1,_device=“/job:localhost/replica:0/task:0/cpu:0”](索引,index_dequeue/n)]]
回溯(最近一次呼叫最后一次):
文件“main3.py”,第120行,在
tf.app.run()
文件“C:\Python35\lib\site packages\tensorflow\python\platform\app.py”,第48行,正在运行
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“main3.py”,第103行,在main中
can.列车(旗帜)
文件“D:\workspace\tensorflow-101.git\CAN\trunk\model3.py”,第273行,列车中
label\u epoch=np.array(self.label\u list)[index\u epoch]
索引器错误:只有整数、片(`:`)、省略号(`…`)、numpy.newaxis(`None`)和整数或布尔数组是有效的索引
完整版本的代码可以在中找到