【已解决】AttributeError: module 'labelme.utils' has no attribute 'draw_label'

问题重现

由于重新装了Anaconda和新的虚拟环境,所以把labelme升级到了最新版,4.2.9。为了实现批量转换,在网上找了代码对json_to_dataset进行了替换,但是,转换时却遇到了如下错误:

Traceback (most recent call last):
  File "/Users/lalala/opt/anaconda3/envs/cv/lib/python3.6/site-packages/labelme/cli/json_to_dataset.py", line 88, in 
    main()
  File "/Users/lalala/opt/anaconda3/envs/cv/lib/python3.6/site-packages/labelme/cli/json_to_dataset.py", line 65, in main
    lbl_viz = utils.draw_label(lbl, img, captions)
AttributeError: module 'labelme.utils' has no attribute 'draw_label'

解决方案

也在网上搜索了修改方案,但是都不work。
灵机一动,labelme降回了3.16.2
然后就没问题了

你可能感兴趣的:(Python错误)