Select to view content in your preferred language

Forest Based Classification - TypeError: 'NoneType' object is not subscriptable

1064
4
06-06-2023 07:35 AM
EmmaSherwood
New Contributor

I'm running a Forest Based Classification and Regression (Spatial Statistics tools), which has worked every other time I've tried it (with various combinations of these variables, all of the layers have been tested & all worked during previous runs). It is now running but ending with the below error message. It gives me results like variable importance, out of bag error, etc in the details pop-up, but none of the layers/files (prediction raster, trained features, uncertainty rasters, variable importance table, confusion matrix) are being created despite the details pop-up saying they are. 

Anyone else have this problem or know what I can do to fix it? Thanks!!

Error messages: 

Traceback (most recent call last):
File "<string>", line 11580, in execute
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\SSForest.py", line 7987, in execute
created = rasterWorkFlow(*infoRasterArg)
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\SSForest.py", line 7854, in rasterWorkFlow
rfRun.executeModel(rfTraining, rfTest = rfTest, rasterInfo = None,
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\SSForest.py", line 5771, in executeModel
self.processRasterByParts(rfTest, randSeed, hpar, newSRF)
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\SSForest.py", line 5573, in processRasterByParts
shareMsg = self.reportShare(rfTraining, shareTraining, shareTest, sharePredict)
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\SSForest.py", line 5130, in reportShare
dataT = shareTraining[cnt]
TypeError: 'NoneType' object is not subscriptable

Additional Details

Using ArcGIS Pro 3.1.2 (tried before and after updating to the current version, same errors). Tried turning computer on and off, restarting ArcGIS, etc. 

Takes about 30 mins to run. Computer has not had issues running this in the past. 

Parameters: No categorical variables, input data are 24 numeric raster layers. 500 trees, 100% of data available per tree, 0% excluded for validation, 20 runs for validation (I want the data from the variable importance table), calculate uncertainty -> TRUE, 

The only other warning I get is WARNING 110228: The Output Classification Performance Table cannot be created when Training Data Excluded For Validation is set to zero. (this is expected as I have already witheld my training data for validation in order to avoid inflated accuracy values due to autocorrelation) 

EDITS:

- I've seen this https://gis.stackexchange.com/questions/419834/error-in-running-forest-based-classification-and-regr... which appears to be the same layer, but using a different training feature layer did not solve my problem 

- I only get the error when I predict to raster - the train-only option does not have this issue. 

4 Replies
RolandDuhaime
Regular Contributor

I am getting this error as well in ArcGIS Pro 3.1.1.

0 Kudos
ChengChia
Esri Contributor

Hello Roland,

It was nice to talk to you at UC. We would like to follow up with the error you encountered, could you share your data with an arcpy command or a screenshot of your parameter setting? So that we can look into the issue?  

0 Kudos
EmmaSherwood
New Contributor

Update: I found a solution (for me!). I think it is likely an issue with this version of the software. TLDR: works with 2.9.0 

After trying to improve my computer's processing, clipping all my files, changing the number of validation runs, number of trees, and basically all other parameters or environment settings, taking all other variables out of the training data file, etc, I started testing with smaller numbers of my predictor variables; I tested with 8 variables and that still didn't work, tested it with a subset (4) of those and that worked! but the other 4 variables also worked, so it was not a problem with my data but rather with the tool being able to handle more variables. 

Copied all my data to another computer I have access to that has 2.9.0 installed, ran it, it works completely fine. Seems like someone at ESRI needs to make a fix somewhere in the 3.1.2 version. 

0 Kudos
ChengChia
Esri Contributor

Hello Emma,

It sounds bad if it is a regression issue, could you share your data with an arcpy command or a screenshot of your parameter setting? So that we can look into the issue?

0 Kudos