Failed to execute "Train Deep Learning Model"

1960
6
01-15-2022 12:16 PM
talebbenEsriPublic
New Contributor II

Errors and warnings:

Traceback (most recent call last):
File "c:\users\xxx\appdata\local\programs\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 296, in execute
data_bunch = prepare_data(in_folders, working_dir=out_folder, **prepare_data_kwargs)
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\_data.py", line 1930, in prepare_data
.label_from_func(get_y_func)
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\data_block.py", line 479, in _inner
self.train = ft(*args, from_item_lists=True, **kwargs)
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\data_block.py", line 303, in label_from_func
return self._label_from_list([func(o) for o in self.items], label_cls=label_cls, **kwargs)
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\data_block.py", line 303, in <listcomp>
return self._label_from_list([func(o) for o in self.items], label_cls=label_cls, **kwargs)
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\_data.py", line 315, in _get_bbox_lbls
label_file, class_mapping, height_width, dataset_type=dataset_type
File "C:\Users\xxx\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\_data.py", line 266, in _get_bbox_classes
float(bnd_box.find("xmin").text),
ValueError: could not convert string to float: '58,82'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\xxx\appdata\local\programs\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 378, in <module>
execute()
File "c:\users\xxx\appdata\local\programs\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 372, in execute
del data_bunch
UnboundLocalError: local variable 'data_bunch' referenced before assignment

 

Thanks for any help=)

6 Replies
DanPatterson
MVP Esteemed Contributor

a description of the data inputs, the exact parameters you were using etc will be needed to interpret the trackback message


... sort of retired...
0 Kudos
talebbenEsriPublic
New Contributor II
thank you for your reply, the image format is Tiff and cel size= 0.08
for more details on the data inputs see the screenshots below.
thanks for your help.
 

Capture333.PNG

 

Capture44.PNG

Capture55.PNG

0 Kudos
PavanYadav
Esri Contributor

Hi @talebbenEsriPublic you may have already solved this. If yes, can you please share how you solve it? 
If you have not, please take a note of "ValueError: could not convert string to float: '58,82'" and your 1st screen-capture. Looks like there seems to be a language / local issue (comma vs. decimal). 

thanks

Pavan

0 Kudos
DavidSheeren
New Contributor

Hi PavanYadav,

I have the same problem when I try to train the model related to palm tree detection.

...
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\_data.py", line 269, in _get_bbox_classes float(bnd_box.find("xmin").text),
ValueError: could not convert string to float: '335,91'

The bndbox values in the XML label files (training dataset folder) are defined with a comma for a decimal value. In my computer, ArcGIS Pro 3 is in an English version. The regional format in my windows is "Français (France)". I changed the win parameters to choose the English format (decimal with point vs comma) but I still have a comma for decimal values in the XML labels files. Any idea to fix this bug?

Thank you! 

 

0 Kudos
PavanYadav
Esri Contributor

@DavidSheeren 
Please correct me if I am incorrect but I am guessing you used the Export Training Data tool when your Windows regional format was France so the tool in the xml used commas for decimal. Now, this became a problem in the Training Deep Learning Models tool because this tool is expecting dots (periods) for commas.

It's a known problem in the Export Training Data tool because other Deep Learning tools don't support non-English languages yet. We have fixed this problem in the Export Training Data tool in the upcoming v3.1. The tool will use dots for decimals.

For now to workaround this problem, you can either try replacing the commas with dots in the xml file or exporting out data with English regional settings. 

DavidSheeren
New Contributor

Thanks!