问题
运行torchvision官方目标检测教程: Penn-Fudan Database for Pedestrian Detection and Segmentation报错:
ValueError: Does not understand character buffer dtype format string ('?')
解决方法
将coco_eval.py文件的112行
mask_util.encode(np.array(mask[0, :, :, np.newaxis], order="F"))[0]
更改为
mask_util.encode(np.array(mask[0, :, :, np.newaxis], dtype=np.uint8, order="F"))[0]
在运行torchvision官方目标检测教程时,遇到Penn-FudanDatabase数据集的ValueError异常,通过修改coco_eval.py文件中mask编码方式,成功解决了'?'字符缓冲区数据类型格式字符串不被理解的问题。
10万+





