使用yaml读取configs下的模型配置文件出错
Created by: omtbreak
我想要使用python下的yaml库读取configs下的 模型名.yml 文件,代码如下
with open('/Users/omtbreak/Desktop/faster_fpn_reader.yml')as file:
cfg = yaml.load(file,Loader=yaml.Loader)
print(cfg)
但是报错
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!COCODataSet'
我看train.py中的源码,同样适用yaml进行读取
with open(file_path) as f:
cfg = merge_config(yaml.load(f, Loader=yaml.Loader), cfg)
个人推测是 !COCODataSet是Paddle对配置文件自定义的标签,希望可以解答如何读取配置文件