Select to view content in your preferred language

Problem with Classify Pixel DLPK

612
4
Jump to solution
08-02-2023 08:48 AM
johnpol
Occasional Contributor

I have a problem using DLPK Super Resolution to apply to a Raster.

 

 

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Unable to read pixels from the python raster function.
Unable to read pixels from the python raster function.
Function Read Error [Raster Function Template]
Unable to read pixels from the python raster function.
Traceback (most recent call last):
File "C:\Users\jpolanco\AppData\Local\Temp\ArcGISProTemp11604\super_resolution.dlpk\ArcGISSuperResolution.py", line 168, in updatePixels
xx = self.child_image_classifier.updatePixels(tlc, shape, props, **pixelBlocks).astype(props['pixelType'], copy=False)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\_superres.py", line 215, in updatePixels
superres_prediction = util.pixel_classify_superres_image(
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\util.py", line 495, in pixel_classify_superres_image
img_normed = norm(tiles.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\util.py", line 22, in <lambda>
norm = lambda x: (x - mean) / std
ValueError: operands could not be broadcast together with shapes (4,400,400,4) (3,)
Python raster function's .updatePixels() method returned nothing.
Unable to read pixels from the python raster function.
Unable to read pixels from the python raster function.
Function Read Error [Raster Function Template]
Unable to read pixels from the python raster function.
Traceback (most recent call last):
File "C:\Users\jpolanco\AppData\Local\Temp\ArcGISProTemp11604\super_resolution.dlpk\ArcGISSuperResolution.py", line 168, in updatePixels
xx = self.child_image_classifier.updatePixels(tlc, shape, props, **pixelBlocks).astype(props['pixelType'], copy=False)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\_superres.py", line 215, in updatePixels
superres_prediction = util.pixel_classify_superres_image(
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\util.py", line 495, in pixel_classify_superres_image
img_normed = norm(tiles.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_inferencing\util.py", line 22, in <lambda>
norm = lambda x: (x - mean) / std
ValueError: operands could not be broadcast together with shapes (4,400,400,4) (3,)
Python raster function's .updatePixels() method returned nothing.
Failed to execute (ClassifyPixelsUsingDeepLearning).

2 Solutions

Accepted Solutions
pyadav
by
New Contributor

@johnpol by any chance your model was trained with 3-band rasters and the above errors was thrown when the model was used against a 4-band raster?

Number of bands (and,  other properties should match e.g. you train a model with 100 cm resolution images, it might not give the best results on 10 cm images). 

View solution in original post

0 Kudos
johnpol
Occasional Contributor

Yes, I found the problem, it was that I used a Raster with 4 bands. I forgot to finish this post, althought thanks for the answer jajaja. Trying to train a model with good results

View solution in original post

4 Replies
pyadav
by
New Contributor

@johnpol by any chance your model was trained with 3-band rasters and the above errors was thrown when the model was used against a 4-band raster?

Number of bands (and,  other properties should match e.g. you train a model with 100 cm resolution images, it might not give the best results on 10 cm images). 

0 Kudos
johnpol
Occasional Contributor

Yes, I found the problem, it was that I used a Raster with 4 bands. I forgot to finish this post, althought thanks for the answer jajaja. Trying to train a model with good results

AlexaVerónicaGarcíaBarrantes
Emerging Contributor

Hello

So if I trained the model with a 3- band raster I won't be able to use it to detect with a 4 band raster? why is that?

0 Kudos
fenglinhan1
New Contributor

I am a newby of arcgis pro. can some one give me a toturial on how to prepare data for this dlpk model?

Use the model—ArcGIS pretrained models | Documentation

i want to try this.

0 Kudos