关于使用ssdlite-mobilenetv3_large训练报错
训练命令:
python tools/train.py -c configs/mobile/ssdlite_mobilenet_v3_large.yml --eval -o use_gpu=false
报错提示:
Traceback (most recent call last):
File "tools/train.py", line 399, in <module>
main()
File "tools/train.py", line 71, in main
cfg = load_config(FLAGS.config)
File "D:\图像处理\实验\PaddleDetection\ppdet\core\workspace.py", line 91, in load_config
cfg = merge_config(yaml.load(f, Loader=yaml.Loader), cfg)
File "D:\图像处理\实验\PaddleDetection\ppdet\core\workspace.py", line 141, in merge_config
dct = dict_merge(dct, config)
File "D:\图像处理\实验\PaddleDetection\ppdet\core\workspace.py", line 121, in dict_merge
for k, v in merge_dct.items():
AttributeError: 'str' object has no attribute 'items'
@dengxinlong
请问您是否有改动?检查下yml配置改动的是否正确。 我在Linux机器上用默认的配置可以跑通。
您好,我是在win10下面跑的,就是根据快速开始下面的命令
将 python tools/train.py -c configs/yolov3_mobilenet_v1_roadsign.yml --eval -o use_gpu=true 改为了
python tools/train.py -c configs/mobile/ssdlite_mobilenet_v3_large.yml --eval -o use_gpu=false 其余均为改变,因为才刚开始试验paddle。请问您在linux在的运行命令是什么,方便告知吗??非常感谢!!!
我是用的命令是:
python -u tools/train.py -c configs/mobile/ssdlite_mobilenet_v3_large.yml
需要注意,数据路径是否正确配置。
https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0-rc/configs/ssd/ssdlite_mobilenet_v3_large.yml#L67
您发的配置文件里面的第67行代码,我看了,因为我是直接按照教程上面的git下来的,所有内容都没有改动。包括您定位的那行dataset_dir: dataset/coco,是一致的。
@dengxinlong 那您本地有 dataset/coco数据路径吗?我是本地软连接了这个数据路径。
您好,因为不方便描述,所有就直接截图,抱歉了。
您好,这样描述问题实在是不太方便,不知道您能否加个联系方式。然后后续我会在在这个问题下面描述整个事件,方便后面遇到问题的人。要不我写一下我的联系方式吧:微信:CodedLong
@dengxinlong 已添加微信~
@dengxinlong
在Window机器上, 您需要使用下面路径, mobile->ssd
python -u tools/train.py -c configs/ssd/ssdlite_mobilenet_v3_large.yml
嗯嗯,好的,非常感谢贵方的解答,关于这部分的问题已经就绝,解决方式就是上面的回复,configs/ 后面不是接mobile,而是直接接该配置文件的真实路径。
由于configs/mobile/ssdlite_mobilenet_v3_large.yml是configs/ssd/ssdlite_mobilenet_v3_large.yml配置文件的软连接,在linux系统下直接运行没有问题,在Windows环境下无法解析软连接,导致解析yaml文件报错,Windows的解决方法是直接使用配置文件原文件:configs/ssd/ssdlite_mobilenet_v3_large.yml。