运行 python tools/train.py configs/pspnet/pspnet_r50-d8_512x512_80k_ade20k.py
时出现
问题
Traceback (most recent call last):
File "tools/train.py", line 242, in <module>
main()
File "tools/train.py", line 167, in main
logger = get_root_logger(log_file=log_file, log_level=cfg.log_level)
File "/home/hyq/hyq/miniconda3/envs/mm/lib/python3.7/site-packages/mmcv/utils/config.py", line 519, in __getattr__
return getattr(self._cfg_dict, name)
File "/home/hyq/hyq/miniconda3/envs/mm/lib/python3.7/site-packages/mmcv/utils/config.py", line 50, in __getattr__
raise ex
AttributeError: 'ConfigDict' object has no attribute 'log_level'
解决:
在configs/pspnet/pspnet_r50-d8_512x512_80k_ade20k.py
中缺少配置信息
_base_ = [
'../_base_/models/pspnet_r50-d8.py', '../_base_/datasets/ade20k.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
或者查看是否缺少../../default_runtime.py
,因为log_level属性包含在default_runtime.py里面
AttributeError: ‘ConfigDict’ object has no attribute ‘log_level’