问题
发生异常: SyntaxError
invalid syntax (<unknown>, line 124)
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
File "/mmsegmentation/tools/train.py", line 103, in main
cfg.dump(__)
File "/mmsegmentation/tools/train.py", line 166, in <module>
main()
注:无法显示具体报错问题
原因
json.dumps()用于将dict类型的数据转成str,但如果直接将dict类型的数据写入json文件中会发生报错。
办法
将字典里的键值对由直接的类型名换成字符串
norm_layer=nn.BatchNorm2d,
换
norm_layer='BatchNorm2d',