ERROR WHEN TRAINING DEEP MODEL

1726
11
09-21-2022 06:04 PM
Labels (1)
AthuleSali
New Contributor II

Hello everyone...

I'm new in arcgis pro and am trying to create a deep learning model so now im stuck in training the model and im getting this error:

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 308, in execute
data_bunch = prepare_data(in_folders, working_dir=out_folder, **prepare_data_kwargs)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3-clone-Athu_DL\Lib\site-packages\arcgis\learn\_data.py", line 1440, in prepare_data
raise Exception(
Exception: Could not infer dataset type. Please specify a supported dataset type or ensure that the path contains valid esri files

During handling of the above exception, another exception occurred:

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 390, in <module>
execute()
File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 384, in execute
del data_bunch
UnboundLocalError: local variable 'data_bunch' referenced before assignment

Failed script (null)...
Failed to execute (TrainDeepLearningModel).

0 Kudos
11 Replies
DanPatterson
MVP Esteemed Contributor

Which of the required inputs are you using?

Train Deep Learning Model (Image Analyst)—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
AthuleSali
New Contributor II

I used the results folder that I got from exported training data for deep learning.

PavanYadav
Esri Contributor

hi @AthuleSali 

This error indicates the issue is with the input data: Exception: Could not infer dataset type. Please specify a supported dataset type or ensure that the path contains valid esri files

Can you please share screen captures the following?
1. input folder contents

2. stats.txt

3. The Train Deep Learning Tool with parameters filled (or, even better if you can share the command. You can copy the python command from the history)?

Thanks

Pavan

 

AthuleSali
New Contributor II

Hellow @PavanYadav 

Thanks for trying to assist, my mistake was really on the input data but I fixed it thank you so much.

AlexaVerónicaGarcíaBarrantes
New Contributor II

Hello AthuleSali

Im having the same issue, what did you do to fix it?

0 Kudos
GBacon
by
Occasional Contributor

I'm having the same issue in Pro v3.2.2. There are tiffs in my \images folder and xml files in my \undefined\labels folder. I've tried running the tool with/without the labels folder. Without the labels folder, I get this error, making me think it needs the labels folder. 

GBacon_2-1712687296074.png

 

However, when I try to include my labels folder, I get the error below even though the exported training files used RCNN masks for the metadata format.

GBacon_1-1712687109796.png

@PavanYadav I appreciate any assistance you can offer.

0 Kudos
PavanYadav
Esri Contributor

hello @GBacon sorry that I missed to see your message.

In the Train Deep Learning Model tool, you need to input the entire folder that is created by the Export Training Data For Deep Learning tool

GBacon
by
Occasional Contributor

Thanks, Pavan. I'm all set now and I have a trained model. 

0 Kudos
AthuleSali
New Contributor II

@PavanYadav can you assist things I can do to get the accurate model? I have have been developing the Unet models since last week and my F1, Precision and Recall are so low. See the attached.

0 Kudos