首页 / 浏览问题 / 桌面GIS / 问题详情
机器学习模型训练
41EXP 2024年03月07日

WIN10x64

版本:11.1.1.230921.9102 x64(SuperMap iObjects Java:11.1.1.105418)

模型训练出现错误以下报错,训练数据生成没错

Python 3.7.16 (default, Jan 17 2023, 16:06:28) [MSC v.1916 64 bit (AMD64)] [iObjectsPy]: The Gateway service started successfully Training Data is inited! D:\supermap-idesktopx\bin_python\iobjectspy\iobjectspy-py37_64\iobjectspy\ml\vision\_models\semantic_seg\_torch_models\geo_api\train_api.py:269: UserWarning: encoder_weights is None, and the data is preprocessed using ImageNet weights Epoch: 1/10 train: 0%| | 0/37 [00:00<!--?, ?it/s] train: 0%| | 0/37 [00:04<?, ?it/s] Traceback (most recent call last): File "<input-->", line 1, in File "D:\supermap-idesktopx\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 "D:\supermap-idesktopx\resources\python-helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:\Users\ADMINI~1\AppData\Local\Temp\model_train.py", line 11, in ImageryTrainer(train_data_path=r"D:\supermap-idesktopx\test\training_data",config=r"D:\supermap-idesktopx\resources_ml\trainer_config\binary_classification\binary_cls_sfnet.sdt",epoch=int(10),batch_size=int(1),lr=1.0E-4,output_model_path=r"D:\supermap-idesktopx\test\zz",output_model_name=r"saved_model",backbone_name=r"efficientnet-b3",backbone_weight_path=r"D:\supermap-idesktopx\resources_ml\backbone\efficientnet-b3-5fb5a3c3.pth",log_path=r"D:\supermap-idesktopx\test\aa",reload_model=False,pretrained_model_path=None,gpus=[0]).binary_classify_train() File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer.py", line 100, in binary_classify_train File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer_collector\binary_classification_train.py", line 36, in train File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_trainer_collector\binary_classification_train.py", line 77, in sfnet_pytorch File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\geo_api\train_api.py", line 104, in train File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\geo_api\train_api.py", line 429, in main_worker File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\util\train.py", line 64, in run File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\util\train.py", line 141, in batch_update File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\torch\nn\parallel\data_parallel.py", line 166, in forward return self.module(*inputs[0], **kwargs[0]) File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\base\model.py", line 14, in forward File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\base\model.py", line 26, in base_forward File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "I:\teamctiy\BuildAgent\work\test_111x/iobjectspy/ml\vision\_models\semantic_seg\_torch_models\encoders\efficientnet.py", line 75, in forward File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\efficientnet_pytorch\model.py", line 78, in forward x = self._swish(self._bn1(self._depthwise_conv(x))) File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\efficientnet_pytorch\utils.py", line 52, in forward return SwishImplementation.apply(x) File "D:\supermap-idesktopx\support\MiniConda\conda\lib\site-packages\efficientnet_pytorch\utils.py", line 39, in forward result = i * torch.sigmoid(i) RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 8.00 GiB total capacity; 764.47 MiB already allocated; 5.27 GiB free; 826.00 MiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

1个回答

您好,您那边模型训练用途使用的是哪个呢?机器显卡配置是什么样的?
9,237EXP 2024年03月08日
提取建筑物轮廓,二元分类,Intel(R) Core(TM) i9-9900K   gpu   gtx2080   8G显存    内存32G
模型训练使用的训练配置文件是哪个呢?不选择segformer这个模型,因为这个模型比较消耗资源。
...