首页 > 其他 > 详细

TypeError: object of type

时间:2020-04-18 14:55:19      阅读:63      评论:0      收藏:0      [点我收藏+]
执行python3 coco_eval.py 报错:
TypeError: ‘numpy.float64‘ object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "coco_eval.py", line 146, in <module>
eval(coco_gt, image_ids, f‘{SET_NAME}_bbox_results.json‘)
File "coco_eval.py", line 118, in eval
coco_eval = COCOeval(coco_gt, coco_pred, ‘bbox‘)
...
.format(type(num)))
TypeError: object of type <class ‘numpy.float64‘> cannot be safely interpreted as an integer.

原因是numpy1.18.2版本与其他软件的兼容性的问题导致。
解决办法:将numpy1.18.2的版本降为1.17,测试可以正常运行。其他可行办法尚未测试。
结果如下:
loading annotations into memory...
Done (t=0.77s)
creating index...
index created!
Loading and preparing results...
DONE (t=5.35s)
creating index...
index created!
BBox
Running per image evaluation...
Evaluate annotation type bbox
DONE (t=129.90s).
Accumulating evaluation results...
DONE (t=12.08s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.326
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.502
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.342
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.118
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.376
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.509
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.268
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.402
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.430
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.172
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.502
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.624

TypeError: object of type

原文:https://blog.51cto.com/10108149/2488381

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!