本文针对faster rcnn训练中出现上述问题及解决的方法进行简单记录。
- 报错信息
2019-12-12 04:51:57.002253: W tensorflow/core/framework/op_kernel.cc:1610] Invalid argument: ValueError: attempt to get argmax of an empty sequence
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/ops/script_ops.py", line 221, in __call__
ret = func(*args)
File "/workspace/tf-faster-rcnn-master/tools/../lib/layer_utils/anchor_target_layer.py", line 51, in anchor_target_layer
argmax_overlaps = overlaps.argmax(axis=1)
- 排查方法
1. 增加文件名信息至训练数据(lib/roi_data_layer/minibatch.py程序的get_minibatch函数)
blobs['addimages']=roidb[0]['image'] #增加语句
blobs['gt_boxes'] = gt_boxes
2. 输出当前训练batch数据的信息(lib/model/train_val.py程序的construct_graph函数)
blobs = self.data_layer.forward()
print ('iter{}, info:{}'.format(iter,blobs))