I was using pre-trained model for human settlement landsat-8 for collecting residential area in ArcGIS Pro. Because the result was not good, i tried to follow this article (https://doc.arcgis.com/en/pretrained-models/latest/imagery/finetuning-the-human-settlements-classification-landsat-8-.htm) hoping it works.
However, i got this error message as shown below:
Train Deep Learning Model
Parameters
Max Epochs 100
Model Type UNET
Batch Size 8
Model Arguments class_balancing False;mixup False;focal_loss False;ignore_classes #;chip_size 224;monitor valid_loss
Learning Rate
Backbone Model RESNET34
Pre-trained Model C:UsersLenovoDownloadsHumanSettlementsClassificationL8.dlpk
Validation % 10
Stop when model stops improving STOP_TRAINING
Output Model
Freeze Model FREEZE_MODEL
Environments
Processor Type GPU
Messages
Start Time: Rabu, 24 April 2024 08.42.50
Runtime Error:Error(s) in loading state_dict for DynamicUnet:
size mismatch for layers.0.0.weight: copying a param with shape torch.Size([64, 8, 7, 7]) from checkpoint, the shape in current model is torch.Size([64, 11, 7, 7]).
size mismatch for layers.10.layers.0.0.weight: copying a param with shape torch.Size([52, 104, 3, 3]) from checkpoint, the shape in current model is torch.Size([53, 107, 3, 3]).
size mismatch for layers.10.layers.0.0.bias: copying a param with shape torch.Size([52]) from checkpoint, the shape in current model is torch.Size([53]).
size mismatch for layers.10.layers.1.0.weight: copying a param with shape torch.Size([104, 52, 3, 3]) from checkpoint, the shape in current model is torch.Size([107, 53, 3, 3]).
size mismatch for layers.10.layers.1.0.bias: copying a param with shape torch.Size([104]) from checkpoint, the shape in current model is torch.Size([107]).
size mismatch for layers.11.0.weight: copying a param with shape torch.Size([2, 104, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 107, 1, 1]).Training not successful.
Traceback (most recent call last):
File “c:program filesarcgisproResourcesArcToolboxtoolboxesImage Analyst Tools.tbxTrainDeepLearningModel.tooltool.script.execute.py”, line 390, in
execute()
File “c:program filesarcgisproResourcesArcToolboxtoolboxesImage Analyst Tools.tbxTrainDeepLearningModel.tooltool.script.execute.py”, line 385, in execute
del training_model_object
UnboundLocalError: local variable ‘training_model_object’ referenced before assignment
Failed script (null)…
Failed to execute (TrainDeepLearningModel).
Failed at Rabu, 24 April 2024 08.42.55 (Elapsed Time: 4,61 seconds)
I did some research about the size mismatch errors, but since the publisher did not specify the trained data, I was hardly to understand the structure.
for this error code, per now, I still cannot find any relevant article
> UnboundLocalError: local variable 'training_model_object' referenced before assignment
Can anyone please explain what the error messages mean and what possible step can I do? I really appreciate any input and help!
Aden Muflih is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.