Hi ESRI community.
I have been working on a custom UNET model to segment water pixels from a standard false colour image. I successfully trained the model and saved it using the Python API, but whenever I try to use it in the Classify Pixel Using Deep Learning tool in Python, the tool tends to run forever. I have recorded a maximum of 4 days during one trial, much so that my computer went off because of overheating.
I then tried to use the same model via the ArcGIS Pro GUI, and it took me approximately 7 hours on the same area (spanning approximately 300 square KM) that I put into the custom script.
Does anyone have any idea why it fails to work via the Python Script, but works on Pro's interface?
For added context, I have the Image Analyst License checked out in the script, and the hardware specs of my PC are as follows:
RAM: 32 GB | Graphics chip: 4 GB NVIDIA Quadro T2000 | CUDA version: 12.8 | Available Storage Space: 700 GB+
Thanks in advance!
I understand you've tried both the arcpy.ia.ClassifyPixelsUsingDeepLearning function in Python and the Classify Pixels Using Deep Learning geoprocessing tool in ArcGIS Pro, and you're seeing a big difference in execution time. You also mentioned your machine has an NVIDIA Quadro T2000 (4 GB VRAM).
Both the Python API call and the ArcGIS Pro geoprocessing tool use the same underlying deep learning framework and should consume similar compute resources, so their performance should be comparable. I'm assuming that in both cases you used the same GPU or CPU, and the same batch size and tile size.
If you're using a GPU, deep learning inference can be very compute-intensive. For training and inference, the recommended GPU VRAM is 8 GB or more. For inference only (classification or detection with a pretrained model), 4 GB is the minimum, but 8 GB is still recommended for better performance and stability.
If your Python script is reading data differently (e.g., from a network location vs. a local disk), I/O speed could also be a factor. Try running both methods on the same local dataset to rule out data access bottlenecks.
Monitor your GPU usage with nvidia-smi (or in Task Manager) to see if GPU memory is the limiting factor. If it is, consider running the process on a GPU with more VRAM for large-area inference.
Hello @PavanYadav , thanks for your helpful reply on this. Yes, you are correct. For both tests (Python API call and Pro GUI), I made use of the same GPU and data. I also made sure they were both reading data from the same local path on y PC, which helped rule that out as a possible issue.
I did monitor the GPU usage as well, and for inferencing only, the maximum I recorded was 2.8 GB /4 GB for the Pro GUI, and 1.9 GB/ 4 GB for the API call.
Additional Note: I also tried the same script on an MSI Cyborg 15 computer with NVIDIA GeForce 4060 8 GB chip, and a 16 GB RAM. The same issue persisted. Although, the Pro GUI took more time to run despite the higher GPU, which I believe to have been because of the smaller RAM on the MSI.