I'm trying to train my model and am getting the following error:
Start Time: Friday, August 19, 2022 8:59:06 AM
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 <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).
Failed at Friday, August 19, 2022 8:59:11 AM (Elapsed Time: 4.73 seconds)
I think this is what's causing the model to fail, but I'm not sure how to rectify this issue.
AttributeError: 'bool' object has no attribute 'any'
Here are the parameters I am using to train the model on a sample area:
I've been messing around with this for over a week and I'm stuck. Any suggestions?
Solved! Go to Solution.
I finally figured this one out. 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). Secondly, you need to have at least two class values in order to train the deep learning model when using the MaskRCNN. Here are the inputs I used that worked:
I finally figured this one out. 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). Secondly, you need to have at least two class values in order to train the deep learning model when using the MaskRCNN. Here are the inputs I used that worked:
Hi Steve
I'm using PASCAL instead of Mask, do you know if I still need to have two class values?
@byrondelgado 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.
thanks
Pavan