1
votes

While training py-faster-rcnn on a custom dataset following the instructions at https://github.com/deboc/py-faster-rcnn/blob/master/help/Readme.md

I encountered some errors like

AttributeError: 'numpy.ndarray' object has no attribute 'toarray' in py-faster-rcnn

which I managed to bypass by editing https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/roi_data_layer/roidb.py

gt_overlaps = roidb[i]['gt_overlaps']
gt_overlaps = sp.sparse.csr_matrix(gt_overlaps).toarray()

However, during the training process, I received a warning twice

RuntimeWarning: invalid value encountered in log targets_dw = np.log(gt_widths / ex_widths)

in the file https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/fast_rcnn/bbox_transform.py

Are the results going to be affected by this ?

Do I need to do something different ?

1

1 Answers

0
votes

maybe u should try to modify “lib/datasets/pascal_voc.py

in the function “_load_pascal_annotation(,)” the right one should be:

x1 = float(bbox.find('xmin').text)                                                                 
y1 = float(bbox.find('ymin').text)                                      
x2 = float(bbox.find('xmax').text)                                                                 
y2 = float(bbox.find('ymax').text) 

the reason is in your own data, x1 or y1 maybe equals to 1, if minus 1,then the number is negative, which caused the error