使用labelme运行labelme_json_to_dataset xxx.json报错TypeError: only integer scalar arrays can be converted
最近刚开始使用labelme,使用labelme_json_to_dataset 000000000095.json进行json到data的转换,但是一直报错
上网查应该就属于数据类型存在问题,我们找到C:\Users\AppData\Roaming\Python\Python36\site-packages\PIL\Image.py会看到
putpalette方法的data参数为a list or a string但是我们传入的参数为numpy.ndarray类型,所以报错。
解决办法:我们打开D:\Anaconda\Lib\site-packages\labelme\utils\_io.py文件,代码修改为
将numpy.ndarray类型转为list类型。
再运行,问题解决。