【Python】yaml库安装

1. Python3.5版本

pip install yaml
parser.add_argument('--cfg', type=str, default='config/yolov3_default.cfg',
                    help='config file. see readme')

with open(args.cfg, 'r') as f:
        cfg = yaml.load(f)

2. Python3.6版本

pip install pyyaml
parser.add_argument('--cfg', type=str, default='config/yolov3_default.cfg',
                    help='config file. see readme')

with open(args.cfg, 'r') as f:
        cfg = yaml.load(f, Loader=yaml.FullLoader)

参考链接: https://github.com/yaml/pyyaml/issues/132

                https://github.com/psss/fmf/commit/610c1e5

你可能感兴趣的:(Python,Python)