AnsweredAssumed Answered

Error 999999 on Train ISO Cluster Classifier

Question asked by JohnWallX on Jan 12, 2018
Latest reply on Jan 12, 2018 by HWei-esristaff

I am trying to run Train ISO Cluster Classifier using Python. Can someone help me identify why I am getting Error 999999?


My code looks like:

import arcpy, os
from arcpy import env
from import *

inRaster = "C:/gis/oberlin/unsupervised/inrasternorm"
path = os.path.dirname(inRaster) #Get directory name
env.workspace = path #Set workspace
env.overwriteOutput = True


#Checkout extensions


#Build directory structure
segmentFolder = path + "/segments" #Stores the segmented images


   classifierFolder = path + "/classifier" #Stores the ECD classifier rules

   classifiedFolder = path + "/classified" #Stores the classified images


#Begin with the Segment Mean Shift variables that need to change
for x in range(5, 16, 1):   
   spectral_detail = x
   for y in range (5, 16, 1):
   spatial_detail = y
   min_segment_size = 100
   seg_raster = SegmentMeanShift(inRaster, spectral_detail, spatial_detail, min_segment_size)
   outName = segmentFolder + '/sms{:02d}_{:02d}.tif'.format(spectral_detail, spatial_detail)



   TrainIsoClusterClassifier("C:/gis/oberlin/unsupervised/segments/sms05_06.tif", 5,    "C:/gis/oberlin/unsupervised/classifier/sms05_06.ecd", "C:/gis/oberlin/unsupervised/inrasternorm", 50, 100, "",    "MEAN")


   #Classify Raster
   classifiedraster = ClassifyRaster(seg_raster, out_definition, in_additional_raster)
   outName2 = classifiedFolder + '/clsfid{:02d}_{:02d}.tif'.format(spectral_detail, spatial_detail)
print "Done!"

However, I get the following error:

Traceback (most recent call last):
File "C:\Python27\ArcGIS10.3\Lib\site-packages\pythonwin\pywin\framework\", line 326, in RunScript
exec codeObject in __main__.__dict__
File "C:\Users\John\Desktop\", line 68, in <module>
TrainIsoClusterClassifier("C:/gis/oberlin/unsupervised/segments/sms05_06.tif", 5, "C:/gis/oberlin/unsupervised/classifier/sms05_06.ecd", "C:/gis/oberlin/unsupervised/inrasternorm", 50, 100, "", "MEAN")
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 7741, in TrainIsoClusterClassifier
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 53, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 7731, in Wrapper
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\", line 504, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (TrainIsoClusterClassifier).