1. 程式人生 > >使用自己製作的coco格式的資料,訓練時候遇到的問題+roidb[0]['dataset'].classes IndexError: list index out of range

使用自己製作的coco格式的資料,訓練時候遇到的問題+roidb[0]['dataset'].classes IndexError: list index out of range

File "/home1/Detectron/lib/datasets/roidb.py", line 71, in combined_roidb_for_training_compute_and_log_stats(roidb)
File "/home1/Detectron/lib/datasets/roidb.py", line 181, in _compute_and_log_stats classes = roidb[0]['dataset'].classes
IndexError: list index out of range

i, I have got same issue and figured it out. The reason was my own data structure's segmentation was wrong. So if you get this issue make sure your own data has same structure as coco.


it more likely the roidb is an empty list, when you read the roidb.py you can see if you miss some information like segmentation , area and so on it would not fill data to the list of roidb

根據上面的回答,查看了一下自己的相關資料項,發現少了一些,新增上去之後,執行的時候還出現同樣的問題.

 

roidb[i]['image'] = imdb.image_path_at(i)

I thought this may be caused by the cache file, you can delete the specific cache files for your training data under the folder fast-rcnn-master/data/cache/, and try again

然後自己就清理了第一次執行產生的cache,然後程式就可以正常運行了。

 一定要清理第一次執行的時候 cache.