首页 / 浏览问题 / 桌面GIS / 问题详情
机器学习模型训练报错
28EXP 2024年07月18日
Python 3.8.16 | packaged by conda-forge | (default, Feb  1 2023, 15:53:35) [MSC v.1929 64 bit (AMD64)] 
[iObjectsPy]: The Gateway service started successfully

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\admin\AppData\Local\Temp\model_train_88.py", line 11, in <module>
    ImageryTrainer(train_data_path=r"E:\yaogantest\self-running-training\Tank training\tank\training_data_3707",config=r"C:\SuperMap\SuperMap iDesktopX 11i\resources_ml\trainer_config\object_detection\object_det_faster_rcnn.sdt",epoch=int(10),batch_size=int(1),lr=1.0E-4,output_model_path=r"E:\yaogantest\self-running-training\Tank training\tank",output_model_name=r"saved_model_0718_tank",backbone_name=r"R-50",backbone_weight_path=r"C:\SuperMap\SuperMap iDesktopX 11i\resources_ml\backbone\R-50.pkl",log_path=r"E:\yaogantest\self-running-training\log file\0718tank_all",reload_model=False,pretrained_model_path=None,gpus=[0]).object_detect_train()
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer.py", line 83, in object_detect_train
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer_collector\object_detection_train.py", line 33, in train
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer_collector\object_detection_train.py", line 37, in faster_rcnn_pytorch
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\object_detection\_torch_models\train_detectron.py", line 182, in train
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\object_detection\_torch_models\train_detectron.py", line 54, in main_single_gpu
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\base_framework\_detectron\_train.py", line 129, in __init__
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\engine\defaults.py", line 378, in __init__
    data_loader = self.build_train_loader(cfg)
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\engine\defaults.py", line 547, in build_train_loader
    return build_detection_train_loader(cfg)
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\config\config.py", line 207, in wrapped
    explicit_args = _get_args_from_config(from_config, *args, **kwargs)
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\config\config.py", line 245, in _get_args_from_config
    ret = from_config_func(*args, **kwargs)
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\data\build.py", line 344, in _train_loader_from_config
    dataset = get_detection_dataset_dicts(
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\data\build.py", line 241, in get_detection_dataset_dicts
    dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\data\build.py", line 241, in <listcomp>
    dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
  File "E:\yaogan\environment\conda\lib\site-packages\detectron2\data\catalog.py", line 58, in get
    return f()
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\base_framework\_detectron\data\register\voc_register.py", line 79, in <lambda>
  File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\base_framework\_detectron\data\register\voc_register.py", line 45, in _load_voc_instances
  File "E:\yaogan\environment\conda\lib\xml\etree\ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "E:\yaogan\environment\conda\lib\xml\etree\ElementTree.py", line 584, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\yaogantest\\self-running-training\\Tank training\\tank\\training_data_3707\\Annotations\\.xml'

xml文件如上

1个回答

您好,您那边训练数据生成用途和模型训练时设置的用途是否一致呢?然后请问下conda环境和iDesktopX的版本是多少呢
9,197EXP 2024年07月19日

您好 我这边是自己构建的训练数据生成的结果文件 之前是可以运行的 但之后又往文件里添加了新的xml和image 就开始报了以上的错误

conda环境和iDesktopX版本如下

重新添加文件后,有在ImageSet文件中补充对应的数据吗?以及sda文件里面是否也添加了
您好 两个我都添加了的 也换了不同的位置和文件试 但是都报了以上错误
您好,能否将你的训练数据打包发我一份呢。我这边看下数据。可以上传百度云盘后私发我链接,谢谢
...