Select to view content in your preferred language

Can't Re-Train ESRI Model

835
10
Jump to solution
05-22-2024 02:21 PM
Labels (3)
rescobar
Occasional Contributor

Hi Folks,

I'm trying to retrain this model: Land Cover Classification (Aerial Imagery) - Overview (arcgis.com)

I run label features for deep learning and then export training data for deep learning.

 
Params.PNG


I then run train deep learning model, but get this error:

Exception: Could not infer dataset type. Please specify a supported dataset type or ensure that the path contains valid exported training data from ArcGIS.


UnboundLocalError: local variable 'data_bunch' referenced before assignment
 
Deep_learning_Train.PNG

 

Is there a key parameter I'm missing?

0 Kudos
1 Solution

Accepted Solutions
rescobar
Occasional Contributor

I was able to retrain the model by the following:

My raster had 4 bands, the model required 3, so I extracted the bands with the "make raster" tool.

I then classified the raster with the "label objects for deep learning" tool. I used this interface to save the training data to a GDB; this creates all the fields needed. I wasn't able to create a training data any other way. If there are fewer classes than what are required by the model, then this will cause an error later. The classes in the schema must also be numbered and named to match the classes specified in the model's emd.

With this feature class and my raster I ran "Export Training Data for Deep Learning". The resulting training data then worked for the "train deep learning model tool".

 

 

View solution in original post

10 Replies
PavanYadav
Esri Contributor

@rescobar Can you please confirm that you followed steps outlined here https://doc.arcgis.com/en/pretrained-models/latest/imagery/finetuning-the-land-cover-classification-...

how many image chips do you have in your training data? 

thanks
Pavan

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos
rescobar
Occasional Contributor

Yes, I cannot get "Export Training Data For Deep Learning" to work out of the toolbox

How many image chips do I need?  I have 500 chips using "Export Training Data For Deep Learning" from the "Label Objects for Deep Learning window". 

If I use export training data for deep learning out of the tool box from a shapefile I get a different error:

ERROR 002088: Feature class has not enough information for supervised training.

 

Error_exporting.PNG

 

0 Kudos
PavanYadav
Esri Contributor

@rescobar your feature class looks right to me. Try to use the Class Value Field parameter. If it does not work, please share it as a zip, I can try to investigate the issue at my end. 

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos
rescobar
Occasional Contributor

Hi @PavanYadav , see the data here:

rescobar_data

 

Thank you!

0 Kudos
PavanYadav
Esri Contributor

@rescobar thanks I will look into it. 

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos
PavanYadav
Esri Contributor

@rescobar looks like rescobar_data has expired. can you please share again? 

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos
rescobar
Occasional Contributor

Hi @PavanYadav  here is an updated link. Thank you!

 

rescobar_data

0 Kudos
PavanYadav
Esri Contributor

@rescobar I'm so sorry but I cannot access the data .. I am sure it's at my end.. can you please email me at pyadav AT esri dot com.. I will share my ftp or you can just try to share it as an email attachment? thanks 

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos
rescobar
Occasional Contributor

Sorry, I've emailed you and shared with google drive rather than one drive:

 

Just following up on your comment on my post in the ESRI forum, I'm now able export training data, but am getting a different error.
 
 
 

 

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, 3, 7, 7]) from checkpoint, the shape in current model is torch.Size([64, 4, 7, 7]). size mismatch for layers.10.layers.0.0.weight: copying a param with shape torch.Size([49, 99, 3, 3]) from checkpoint, the shape in current model is torch.Size([50, 100, 3, 3]). size mismatch for layers.10.layers.0.0.bias: copying a param with shape torch.Size([49]) from checkpoint, the shape in current model is torch.Size([50]). size mismatch for layers.10.layers.1.0.weight: copying a param with shape torch.Size([99, 49, 3, 3]) from checkpoint, the shape in current model is torch.Size([100, 50, 3, 3]). size mismatch for layers.10.layers.1.0.bias: copying a param with shape torch.Size([99]) from checkpoint, the shape in current model is torch.Size([100]). size mismatch for layers.11.0.weight: copying a param with shape torch.Size([9, 99, 1, 1]) from checkpoint, the shape in current model is torch.Size([4, 100, 1, 1]). size mismatch for layers.11.0.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([4]).Training not successful.

 

 

 

Traceback (most recent call last):  File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 397, in <module>    execute()  File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 392, in execute    del training_model_object UnboundLocalError: local variable 'training_model_object' referenced before assignment
 
 
 
 
 
Thank you for your help!

 

0 Kudos