我在onTensorFlow上运行我的代码,我得到了丢失的价值。 现在我想使用TensorFlow Debugger来调试我的数据,但是当我在代码中添加调试器时,如下所示,
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
完整版代码可以在here
中找到