Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
- From: Jason Roberts <>
- To: Marc Nelson <>
- Cc: "" <>
- Subject: RE: [mget-help] Failure to execute Predict Random Forest From Rasters
- Date: Mon, 30 Jan 2017 15:38:56 +0000
- Accept-language: en-US
- Authentication-results: spf=none (sender IP is ) ;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi Marc,
Your screenshot looks ok to me. I’m not sure why this problem would occur. When you don’t provide a Template Raster, MGET takes the first Predictor Raster as the template. MGET asked ArcGIS for some metadata about this raster and the “describe” object that came back from ArcGIS did not have a MeanCellWidth attribute. This is how MGET determines the cell size of the raster. As far as I know, it should never be the case that a raster does not have a MeanCellWidth.
I have several suggestions:
1. If you have not tried this already, close ArcGIS, start it again, and try the predict tool right away. MGET loads some third-party libraries such as GDAL that are rather complicated. It may be there is some conflict between these and what ArcGIS itself loads. Usually this would result in ArcGIS crashing but perhaps it could result in this problem. This is a very rare situation, so I don’t think it is what is happening, but closing and restarting is easy to try, so might as well try it.
2. Try explicitly giving the tool a Template Raster. I don’t think this will make a difference, but it is worth trying.
3. For Predictor Rasters, rather than raster selecting layers that you have loaded into ArcMap, instead use the “open folder” button and select them again from disk, rather than selecting them from the drop-down menu. Sometimes ArcGIS has funky differences between raster “layers” and raster “datasets”. The way you tried it in your screenshot is with the “layers”. By selecting them again from disk, they’ll be “datasets”.
4. If those rasters are separate bands of a single raster, try copying them out to their own independent rasters. Sometimes bands are not handled by ArcGIS the same way as independent rasters.
5. Try the prediction from the stand alone ArcCatalog program rather than ArcMap. If 3 or 4 did not solve it, there is a small chance this could.
My guess is that it is either 3 or 4 that is the problem. Regardless, if we can isolate a scenario that causes this 100% of the time, and a scenario that solves it, I would be interested in hearing those details to see if I could fix MGET to handle the broken scenario.
Best,
Jason From: [mailto:]
On Behalf Of Marc Nelson
Hi Jason / team,
I'm getting an error when trying to run the 'Predict Random Forest From Rasters' tool. I have 20 sat bands and 1 topographic metric as my variables. Based on the image below, have I entered the Predictor Variable fields correctly?
Here's the code, thanks so much in advance:
Running script RandomForestModelPredictFromArcGISRasters... Failed script RandomForestModelPredictFromArcGISRasters...
Traceback (most recent call last): File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\RandomForestModelPredictFromArcGISRasters.py", line 5, in <module> ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.Statistics.Modeling', 'RandomForestModel', 'PredictFromArcGISRasters') File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\ArcGISScripts.py", line 210, in ExecuteMethodFromCommandLineAsArcGISTool exec sourceCode in globals(), locals() File "<string>", line 1, in <module> File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\Statistics\Modeling.py", line 776, in PredictFromArcGISRasters _PredictFromArcGISRasters('randomForest', _(u'Fit Random Forest Model'), inputModelFile, outputResponseRaster, cutoff, constantPredictors, predictorRasters, templateRaster, ignoreOutOfRangeValues, None, buildPyramids, overwriteExisting) File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\Statistics\Modeling.py", line 1570, in _PredictFromArcGISRasters cellSize = templateDescribe.MeanCellWidth File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\ArcGIS.py", line 1015, in __getattr__ raise ArcGISError(_(u'Failed to get the value of the %s attribute of ArcGIS %s object 0x%08X. This may result from a problem with your inputs or it may indicate a programming mistake in this tool or ArcGIS itself. Please check your inputs and try again. Also review any preceding error messages and the detailed error information that appears at the end of this message. If you suspect a programming mistake in this tool or ArcGIS, please contact the author of this tool for assistance. Detailed error information: The following exception was raised when the property retrieved: %s: %s') % (name, self._Name, id(self._Object), e.__class__.__name__, unicode(e))) ArcGISError: Failed to get the value of the MeanCellWidth attribute of ArcGIS Describe object 0x4FF61CE0. This may result from a problem with your inputs or it may indicate a programming mistake in this tool or ArcGIS itself. Please check your inputs and try again. Also review any preceding error messages and the detailed error information that appears at the end of this message. If you suspect a programming mistake in this tool or ArcGIS, please contact the author of this tool for assistance. Detailed error information: The following exception was raised when the property retrieved: AttributeError: DescribeData: Method MeanCellWidth does not exist
Failed to execute (RandomForestModelPredictFromArcGISRasters). Failed at Mon Jan 30 16:02:02 2017 (Elapsed Time: 0,60 seconds) |
- [mget-help] Failure to execute Predict Random Forest From Rasters, Marc Nelson, 01/30/2017
- RE: [mget-help] Failure to execute Predict Random Forest From Rasters, Jason Roberts, 01/30/2017
Archive powered by MHonArc 2.6.19.