[python][原创]labelme_json_to_dataset没有生成info.yaml解决方法

本文针对ubuntu系统,如果你是windows可以用everything软件搜索,加入代码都是一样的

找到json_to_dataset.py

sudo find / -name labelme_json_to_dataset

打开文件gedit /home/fut/miniconda3/lib/python3.8/site-packages/labelme/cli/json_to_dataset.py

加入下面代码

    import yaml

    logger.warning('info.yaml is being replaced by label_names.txt')
    info = dict(label_names=label_names)
    with open(osp.join(out_dir, 'info.yaml'), 'w') as f:
        yaml.safe_dump(info, f, default_flow_style=False)

import加在头部

代码加在__name__上面即可

扫描二维码关注公众号,回复: 12621705 查看本文章

猜你喜欢

转载自blog.csdn.net/FL1623863129/article/details/112317861