<?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 UnboundLocalError when calling 'Classified_Tiles' in prepare_data in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858969#M4126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've exported Classfied_Tile formatted image chips from ArcGIS Pro to train a Unet Classifier. However, when setting up 'prepare_data' function I get an UnboundLocalError. I'm running this in Jupyter Lab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data = prepare_data(data_path, {1:'Ocean', 2:'Sand', 3:'Mud', 4:'Pond', 5:'Red Pond', 6:'Foam', 7:'Tundra', 8:'Bare', 9:'Mud' }, batch_size=16, dataset_type = 'Classified_Tiles')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE style="color: var(--jp-content-font-color1); border: none; font-size: 13px;"&gt;&lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;UnboundLocalError&lt;/SPAN&gt;                         Traceback (most recent call last)&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;&amp;lt;ipython-input-9-ab7c0384d6f5&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;()&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      5&lt;/SPAN&gt; &lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;# however, this notebook leaves out the fact that you need to directly infer that to the script with 'dataset_type'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      6&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;----&amp;gt; 7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt; &lt;/SPAN&gt;data &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt; prepare_data&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;data_path&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Ocean'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;2&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Sand'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;3&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Mud'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Pond'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;5&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Red Pond'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;6&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Foam'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Tundra'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;8&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Bare'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;9&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Mud'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; batch_size&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;16&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; dataset_type &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Classified_Tiles'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;~\AppData\Local\ESRI\conda\envs\palm-detection\lib\site-packages\arcgis\learn\_data.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;prepare_data&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;(path, class_mapping, chip_size, val_split_pct, batch_size, transforms, collate_fn, seed, dataset_type, resize_to, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    463&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;elif&lt;/SPAN&gt; dataset_type &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;==&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Classified_Tiles'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    464&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;--&amp;gt; 465&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;         &lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;def&lt;/SPAN&gt; get_y_func&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; ext&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt;right&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    466&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;return&lt;/SPAN&gt; x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;parents&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;/&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'labels'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;/&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;stem &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;+&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'.{}'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;ext&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    467&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;UnboundLocalError&lt;/SPAN&gt;: local variable 'right' referenced before assignment&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should mention, I don't get this error when using PASCAL rectangles for SSO training. Looks like it has something to do with classified tiles format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me get around this?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2020 21:52:43 GMT</pubDate>
    <dc:creator>stephenescarzaga</dc:creator>
    <dc:date>2020-01-22T21:52:43Z</dc:date>
    <item>
      <title>UnboundLocalError when calling 'Classified_Tiles' in prepare_data</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858969#M4126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've exported Classfied_Tile formatted image chips from ArcGIS Pro to train a Unet Classifier. However, when setting up 'prepare_data' function I get an UnboundLocalError. I'm running this in Jupyter Lab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data = prepare_data(data_path, {1:'Ocean', 2:'Sand', 3:'Mud', 4:'Pond', 5:'Red Pond', 6:'Foam', 7:'Tundra', 8:'Bare', 9:'Mud' }, batch_size=16, dataset_type = 'Classified_Tiles')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE style="color: var(--jp-content-font-color1); border: none; font-size: 13px;"&gt;&lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;UnboundLocalError&lt;/SPAN&gt;                         Traceback (most recent call last)&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;&amp;lt;ipython-input-9-ab7c0384d6f5&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;()&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      5&lt;/SPAN&gt; &lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;# however, this notebook leaves out the fact that you need to directly infer that to the script with 'dataset_type'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      6&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;----&amp;gt; 7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt; &lt;/SPAN&gt;data &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt; prepare_data&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;data_path&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Ocean'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;2&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Sand'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;3&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Mud'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Pond'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;5&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Red Pond'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;6&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Foam'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Tundra'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;8&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Bare'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;9&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Mud'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; batch_size&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;16&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; dataset_type &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Classified_Tiles'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;~\AppData\Local\ESRI\conda\envs\palm-detection\lib\site-packages\arcgis\learn\_data.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;prepare_data&lt;/SPAN&gt;&lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;(path, class_mapping, chip_size, val_split_pct, batch_size, transforms, collate_fn, seed, dataset_type, resize_to, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    463&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;elif&lt;/SPAN&gt; dataset_type &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;==&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'Classified_Tiles'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    464&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;--&amp;gt; 465&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;         &lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;def&lt;/SPAN&gt; get_y_func&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;,&lt;/SPAN&gt; ext&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;=&lt;/SPAN&gt;right&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    466&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #00a250; font-weight: bold;"&gt;return&lt;/SPAN&gt; x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;parents&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #60c6c8; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;/&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'labels'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;/&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;stem &lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;+&lt;/SPAN&gt; &lt;SPAN class="" style="color: #208ffb; font-weight: bold;"&gt;'.{}'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;(&lt;/SPAN&gt;ext&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ddb62b; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    467&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #e75c58; font-weight: bold;"&gt;UnboundLocalError&lt;/SPAN&gt;: local variable 'right' referenced before assignment&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should mention, I don't get this error when using PASCAL rectangles for SSO training. Looks like it has something to do with classified tiles format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me get around this?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 21:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858969#M4126</guid>
      <dc:creator>stephenescarzaga</dc:creator>
      <dc:date>2020-01-22T21:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: UnboundLocalError when calling 'Classified_Tiles' in prepare_data</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858970#M4127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone from ESRI want to chime in on this??!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking through the _data.py library, I think I know what's going on. prepare_data is expecting there to be a "esri_accumulated_stats.json" to be in the export directory that Pro creates when you export your training data. However, this file is never created in the process. In _data.py, it searchers for this .json, doesn't find it&amp;nbsp; and&amp;nbsp;then jumps to a line (around 465) where "right" is called in a function, but "right" is declared outside of the scope. Attached to this post is a screen shot of the data directory that gets created during "Export Training Data for Deep Learning".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated Pro to 2.4.3 and it still does this.&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/480224_Capture.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2020 02:49:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858970#M4127</guid>
      <dc:creator>stephenescarzaga</dc:creator>
      <dc:date>2020-02-04T02:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: UnboundLocalError when calling 'Classified_Tiles' in prepare_data</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858971#M4128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG __jive_id="482065" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482065_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You ESRI model definition file is missing, what is the version of your&amp;nbsp;ArcGIS pro. Can you try again using &lt;SPAN&gt;ArcGIS&lt;/SPAN&gt; pro 2.4 or above ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 05:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858971#M4128</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-02-13T05:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: UnboundLocalError when calling 'Classified_Tiles' in prepare_data</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858972#M4129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've updated ArcGIS Pro to 2.5.0 and it is now exporting the esri_accumulated_stats files I need to make this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also had had to reclone the arcgis python3 environment and install the latest deep learning libraries that are recommended by esri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 05:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unboundlocalerror-when-calling-classified-tiles-in/m-p/858972#M4129</guid>
      <dc:creator>stephenescarzaga</dc:creator>
      <dc:date>2020-02-13T05:24:56Z</dc:date>
    </item>
  </channel>
</rss>

