tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0] = 82620 is not in [0, 81648

人工智能92

最近在复现别人代码的时候,遇到如下问题:

Traceback (most recent call last):
File "/home/robot/.virtualenvs/tensor/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/home/robot/.virtualenvs/tensor/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/home/robot/.virtualenvs/tensor/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0] = 82620 is not in [0, 81648)
[[{{node ROI/GatherV2_2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/robot/文档/ye/code/1dense-clutter-grasp-master/algorithm/detection_algorithm.py", line 407, in

Original stack trace for 'ROI/GatherV2_2':
File "/文档/ye/code/1dense-clutter-grasp-master/algorithm/detection_algorithm.py", line 407, in

找了好久也没找到解决方法,最后发现一个类似的问题,解决方法是:在model.py中加上两行

mask = tf.greater(tf.shape(anchors)[1], ix, name="bool_mask")
ix = tf.stack([tf.boolean_mask(ix, mask)])

Original: https://blog.csdn.net/qq_37906928/article/details/121667375
Author: 小小菜叶
Title: tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0] = 82620 is not in [0, 81648