用detecteon2训练cascadeRCNN,本来想跑个小数据集看看能不能跑通,但跑200~300个iter就会报如下错误:
RuntimeError: cannot perform reduction function argmax on a tensor with no elements because the operation does not have an identity
其实是./modeling/roi_heads/cascade_rcnn.py
中175行运行self._run_stage(features, proposals, k)
时出错了,预测出了空的predictions.
再一想,突然想到,可能是我的batchsize=1导致的(不用cascadeRCNN的时候batchsize=1没出过错…)
把batchsize改大一点,立即解决…
影响_run_stage输出结果的还有ROI_HEADS.ROI_BOX_CASCADE_HEAD.IOUS
(list)参数,这个设置了每个阶段的阈值。 上面参数的0-th元素要与ROI_HEADS.IOU_THRESHOLDS
的值相同。