码迷,mamicode.com
首页 > 其他好文 > 详细

TypeError: object of type

时间:2020-04-18 15:39:47      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:The   问题   ted   except   other   解决   ror   dex   ast   

执行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

标签:The   问题   ted   except   other   解决   ror   dex   ast   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!