首页 / 浏览问题 / 桌面GIS / 问题详情
机器学习对象提取模型训练报错
28EXP 2024年07月03日
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\SuperMap\SuperMap iDesktopX 11i\resources\python-helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\SuperMap\SuperMap iDesktopX 11i\resources\python-helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:\Users\ht\AppData\Local\Temp\model_train_1.py", line 11, in <module>
    ImageryTrainer(train_data_path=r"D:\能源遥感\training_data\PHO\training_data_e1班幸",config=r"C:\SuperMap\SuperMap iDesktopX 11i\resources_ml\trainer_config\object_extraction\object_ext_mmdet_mask_rcnn.sdt",epoch=int(15),batch_size=int(1),lr=1.0E-4,output_model_path=r"D:\能源遥感\training_data\PHO",output_model_name=r"saved_model_e1班幸",backbone_name=r"r-50",backbone_weight_path=r"C:\SuperMap\SuperMap iDesktopX 11i\resources_ml\backbone\resnet50-19c8e357.pth",log_path=r"D:\能源遥感\log file\0713pho_e1班幸",reload_model=False,pretrained_model_path=None,gpus=[0]).object_extract_train()
  File "I:\teamctiy\BuildAgent\work\test_trunk/iobjectspy/ml\vision\_trainer.py", line 139, in object_extract_train
  File "I:\teamctiy\BuildAgent\work\test_trunk/iobjectspy/ml\vision\_trainer_collector\object_extraction_train.py", line 32, in train
  File "I:\teamctiy\BuildAgent\work\test_trunk/iobjectspy/ml\vision\_trainer_collector\object_extraction_train.py", line 45, in mmdet_pytorch
  File "I:\teamctiy\BuildAgent\work\test_trunk/iobjectspy/ml\vision\_models\base_framework\_mmdet\common_train_mmdet.py", line 539, in train
  File "I:\teamctiy\BuildAgent\work\test_trunk/iobjectspy/ml\vision\_models\base_framework\_mmdet\common_train_mmdet.py", line 499, in main_train
  File "C:\SuperMap\supermap-iobjectspy-env-gpu-11.1.0-win64\conda\lib\site-packages\mmengine\runner\runner.py", line 1701, in train
    self._train_loop = self.build_train_loop(
  File "C:\SuperMap\supermap-iobjectspy-env-gpu-11.1.0-win64\conda\lib\site-packages\mmengine\runner\runner.py", line 1493, in build_train_loop
    loop = LOOPS.build(
  File "C:\SuperMap\supermap-iobjectspy-env-gpu-11.1.0-win64\conda\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\SuperMap\supermap-iobjectspy-env-gpu-11.1.0-win64\conda\lib\site-packages\mmengine\registry\build_functions.py", line 144, in build_from_cfg
    raise type(e)(
TypeError: class `EpochBasedTrainLoop` in mmengine/runner/loops.py: function takes exactly 5 arguments (1 given)

训练数据生成运行成功 这模型训练时选择对象提取 模型算法选择 Mask R-CNN 报出以上错误

1个回答

报错提示参数不匹配,建议:

1、检查参数设置,以及截图看看,包括训练配置文件sdt用记事本打开看看内部存储的骨干网络的路径

2、从报错提示中发现很多路径带中文、空格等特殊符号,建议更换所有路径,用纯英文试试
1,520EXP 2024年07月03日

您好 我这边改完英文路径还是同样的报错 再帮忙看一下是什么问题呗 谢谢!

初步判断像是版本不一致的原因导致,建议训练时模型配置文件换一个试试,把object_ext_mmdet_mask_rcnn.sdt换为其他算法的
...