<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error when training deep learning model in ArcGIS Image Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1254999#M369</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/441118"&gt;@byrondelgado&lt;/a&gt;&amp;nbsp;Hi, have you been able to get it work. From the attached error, it looks like there was an internet issue. thanks in advance for any details you may share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 19:43:16 GMT</pubDate>
    <dc:creator>PavanYadav</dc:creator>
    <dc:date>2023-02-03T19:43:16Z</dc:date>
    <item>
      <title>Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1204540#M348</link>
      <description>&lt;P&gt;I'm trying to train my model and am getting the following error:&lt;/P&gt;&lt;PRE&gt;Start Time: Friday, August 19, 2022 8:59:06 AM&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;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\Lib\site-packages\arcgis\learn\_data.py", line 1822, in prepare_data
    ArcGISInstanceSegmentationItemList.from_folder(path / "images")
  File "C:\Program Files\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:\Program Files\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:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\data_block.py", line 279, in _label_from_list
    y = label_cls(labels, path=self.path, **kwargs)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_maskrcnn_utils.py", line 97, in __init__
    if is_no_color(list(color_mapping.values())):
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_maskrcnn_utils.py", line 70, in is_no_color
    return (np.array(color_mapping) == [-1.0, -1.0, -1.0]).any()
AttributeError: 'bool' object has no attribute 'any'

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 &amp;lt;module&amp;gt;
    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&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Failed script (null)...&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Failed to execute (TrainDeepLearningModel).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Failed at Friday, August 19, 2022 8:59:11 AM (Elapsed Time: 4.73 seconds)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this is what's causing the model to fail, but I'm not sure how to rectify this issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;AttributeError: 'bool' object has no attribute 'any'&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the parameters I am using to train the model on a sample area:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveCacioppo_0-1660919707079.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49007i8D914773E9E7E768/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveCacioppo_0-1660919707079.png" alt="SteveCacioppo_0-1660919707079.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveCacioppo_1-1660919778764.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49008i81D8EA80CFA955E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveCacioppo_1-1660919778764.png" alt="SteveCacioppo_1-1660919778764.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've been messing around with this for over a week and I'm stuck.&amp;nbsp; Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 14:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1204540#M348</guid>
      <dc:creator>SteveCacioppo</dc:creator>
      <dc:date>2022-08-19T14:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1206730#M349</link>
      <description>&lt;P&gt;I finally figured this one out.&amp;nbsp; First of all, when using the MaskRCNN model for object detection, the class values for the input training data must start at 1 (I was using 0).&amp;nbsp; Secondly, you need to have at least two class values in order to train the deep learning model when using the MaskRCNN.&amp;nbsp; Here are the inputs I used that worked:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveCacioppo_0-1661521564562.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49543i867A7C19FF383388/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveCacioppo_0-1661521564562.png" alt="SteveCacioppo_0-1661521564562.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveCacioppo_1-1661521590642.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49544iE19AE224B37EB507/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveCacioppo_1-1661521590642.png" alt="SteveCacioppo_1-1661521590642.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveCacioppo_2-1661521610238.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49545i60A0E106BFFAC747/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveCacioppo_2-1661521610238.png" alt="SteveCacioppo_2-1661521610238.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 13:47:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1206730#M349</guid>
      <dc:creator>SteveCacioppo</dc:creator>
      <dc:date>2022-08-26T13:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1240863#M368</link>
      <description>&lt;P&gt;Hi Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read and followed your instructions but still no luck. Please, can you be more specific with the values recommendations for the values assigned to the samples?&amp;nbsp; Here attached are the messages I get when trying to train the model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you and regards...&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 23:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1240863#M368</guid>
      <dc:creator>byrondelgado</dc:creator>
      <dc:date>2022-12-13T23:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1254999#M369</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/441118"&gt;@byrondelgado&lt;/a&gt;&amp;nbsp;Hi, have you been able to get it work. From the attached error, it looks like there was an internet issue. thanks in advance for any details you may share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 19:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1254999#M369</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2023-02-03T19:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1345890#M502</link>
      <description>&lt;P&gt;Hi Steve&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using PASCAL instead of Mask, do you know if I still need to have two class values?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 16:44:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1345890#M502</guid>
      <dc:creator>AlexaVerónicaGarcíaBarrantes</dc:creator>
      <dc:date>2023-11-04T16:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1553808#M747</link>
      <description>&lt;P&gt;Hello, please I am having a similar issue here, I am using CPU and not GPU for this processing. I am aware the CPU can be used. I have reduced batch sizes from 16-12-8-4-2 yet unsuccessful. I will appreciate solutions achieved by anyone who has encountered this before. Thank you&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Omoige23_0-1730303296378.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118463iC9A9851C16122C4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Omoige23_0-1730303296378.png" alt="Omoige23_0-1730303296378.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Omoige23_1-1730303296417.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118462iBEF200BE7D79E9C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Omoige23_1-1730303296417.png" alt="Omoige23_1-1730303296417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 15:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1553808#M747</guid>
      <dc:creator>Omoige23</dc:creator>
      <dc:date>2024-10-30T15:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1554535#M750</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/674298"&gt;@Omoige23&lt;/a&gt;&amp;nbsp;this just appears wrong to me. If CPU or batch size was a problem, the tool would have returned error/messages. I see it trained up to 20 epochs and at the time of saving the model it failed. Is it possible for your to share the training data? If yes, please email me at pyadav AT esri DOT com.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The origional post was about&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class=""&gt;UnboundLocalError: local variable 'data_bunch' referenced before assignment&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I assume you don't see this error. Right?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 21:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1554535#M750</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2024-10-31T21:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1554798#M754</link>
      <description>&lt;P&gt;Thank you Pavan Yadav,&lt;/P&gt;&lt;P&gt;This is the data I tried using to familiarize with the process.&amp;nbsp;&lt;A href="https://learn.arcgis.com/en/projects/classify-mangroves-using-deep-learning/" target="_blank"&gt;https://learn.arcgis.com/en/projects/classify-mangroves-using-deep-learning/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I planned to apply this method to another AOI in the research my student is carrying out. I would be glad to receive any help to guide me in helping my student actualize her dream.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also sent same message to you via LinkedIn so i can connect with you there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope to hear from you soon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 18:08:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1554798#M754</guid>
      <dc:creator>Omoige23</dc:creator>
      <dc:date>2024-11-01T18:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error when training deep learning model</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1565789#M768</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/674298"&gt;@Omoige23&lt;/a&gt;&amp;nbsp;Hi, I am so sorry for the delayed response. I am also struggling to find your message in Linkedin. If you're okay, please email me at pyadav AT esri DOT com.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 19:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/error-when-training-deep-learning-model/m-p/1565789#M768</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2024-12-06T19:45:02Z</dc:date>
    </item>
  </channel>
</rss>

