Select to view content in your preferred language

Arcpy Detect Object Using Deep Learning error read input raster

455
3
01-03-2024 11:27 PM
Labels (2)
gishustle
New Contributor

Hi, I am trying to do object detection process with standalone script using Arcpy. The arcgis pro version is ArcGIS Pro 3.2.1. I made this script based on model builder and this documentation.

https://pro.arcgis.com/en/pro-app/latest/tool-reference/image-analyst/detect-objects-using-deep-lear... 

The script i use is written below.

import arcpy
from arcpy.ia import *

arcpy.CheckOutExtension("ImageAnalyst")

in_models = 'C:/Users/GIS Dev/Documents/Riset_arcpy/model_map_space/model_5_epoch/model_5_epoch.dlpk'
data_raster = 'C:/Users/GIS Dev/Documents/Riset_arcpy.ia/Radarsat-2-4978_I005632_FL01-P008585_Scene_1_2023_08_20_22_01_42/tif'
obj_detection = 'obj.shp'
model_args = "padding 56; threshold 0.5; nms_overlap 0.1; batch_size 64; exclude_pad_detections True; test_time_augmentation False"
run_nms = "NO_NMS"
confidence_score_field = "Confidence"
class_value_field = "Class"
max_overlap_ratio = 0
processing_mode = "PROCESS_AS_MOSAICKED_IMAGE"
arcpy.env.extent = arcpy.Extent(113.7975122046781706, -7.7461582880389077, 114.0177164475001632, -7.4046301537038710)
Output_Classified_Raster = arcpy.ia.DetectObjectsUsingDeepLearning(data_raster,
obj_detection,
in_models,
model_args,
run_nms,
confidence_score_field,
class_value_field,
max_overlap_ratio,
processing_mode)
When i ran this script it shows error like this
 
Traceback (most recent call last):
File "C:\Users\GIS Dev\Documents\Riset_arcpy.ia\Radarsat-2-4978_I005632_FL01-P008585_Scene_1_2023_08_20_22_01_42\tif\obj.py", line 16, in <module>
Output_Classified_Raster = arcpy.ia.DetectObjectsUsingDeepLearning(data_raster,
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\Functions.py", line 4040, in DetectObjectsUsingDeepLearning
return Wrapper(
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 55, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\Functions.py", line 4029, in Wrapper
result = arcpy.gp.DetectObjectsUsingDeepLearning_ia(
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 520, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: A raster error has occurred. The messages that follow will provide more detail.
No raster store is configurated. [No SQL data store]
No raster store is configurated. [No SQL data store]
Failed to execute (DetectObjectsUsingDeepLearning).
 
I cant figure out the solution for this. With the same scenario it ran without error in ArcGIS Pro.
 
0 Kudos
3 Replies
CordulaGöke
Occasional Contributor

I have had a similar error using detect objects using deep learning as a "click through" tool. I copied from the history over to jupyter & set  workspace to in memory and it ran now 3 times in a row.

0 Kudos
JonMarrs
New Contributor

Are you saying that running the script in a Jupyter notebook rather than ArcGIS Pro GUI fixed the problem?

0 Kudos
CordulaGöke
Occasional Contributor

@JonMarrs switching to jupyter and setting in memory as workspace. As far as I remember, it was not enough to switch to jupyter alone.

 

 

0 Kudos