TypeError: Object of type 'int32' is not JSON serializable

TypeError: Object of type ‘int32’ is not JSON serializable

在运行将labelme标注产生的json文件转换成coco数据集的json格式的代码时,遇到错误:TypeError: Object of type ‘int32’ is not JSON serializable。
原因:labelme标注产生的json文件中的"points"中的值为int型,将其转换成float型即可。
如:将
在这里插入图片描述

转换为
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_37754309/article/details/88963274
今日推荐