ArcGIS Image Server provides a suite of deep learning tools with end-to-end workflows to classify and detect objects in imagery. These tools allow you to generate training sample datasets and export them to a deep learning framework to develop a deep learning model. Then you can perform data inference workflows, such as image classification and object detection.
Note:
To take advantage of GPU processing on a multiple-machine raster analytics server site running Windows, at least one GPU must be available on each server node on the site. A GPU card is not required to run the deep learning tools on your raster analytics deployment of ArcGIS Image Server. If the raster analytics server machine does not have a GPU card, the tools can be run on the CPU. For the raster analytics server machine with only CPU, the users need to install MKL (Math Kernel Library) build of the deep learning Python libraries specifically for TensorFlow and Pytorch packages.
At 10.8, deep learning inference raster analytics can use multiple GPUs simultaneously on one machine.
Note:
Raster analytics in an ArcGIS Image Server environment can use the TensorFlow, PyTorch, CNTK, and Keras Python modules with GPUs. Utilization of multiple GPUs per server node is applicable to some deep learning model configurations predefined in ArcGIS. They include Tensorflow (ObjectDetectionAPI and DeepLab), Keras (MaskRCNN), and PyTorch.
Add support for deep learning to a Windows raster analytics deployment
Once you've configured your raster analytics deployment, follow the steps below to install the deep learning Python resources in a Windows environment. If you have a multinode ArcGIS Image Server site, repeat these steps on each server node.
The OS account you use for these steps must be the same as the account that installed ArcGIS Image Server.
- If you want to use GPUs for your deep learning raster analytics workflow, install the appropriate NVIDIA GPU drivers.
- Browse to the default Python environment provided with your ArcGIS Server setup. This default Python setup is in C:\Program Files\ArcGIS\Server\framework\runtimes\ArcGIS\bin\Python.
- Activate the default Python environment arcgispro-py3. In the C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts folder, type the command .\proenv.bat.
- Clone a new Python environment from the default Python environment arcgispro-py3. Type the command, conda create --name DeepLearningEnv --clone arcgispro-py3.
You can specify new deep learning Python environment name, such as “DeepLearningEnv”
- Activate the new Python environment. Type the command, activate DeepLearningEnv. Once the new Python environment is activated, the new environment name shows up at the beginning of the path: (DeepLearningEnv) C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts\
- Install all the required deep learning Python libraries. In the C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts folder, type the commands:
- conda install tensorflow-gpu=1.14.0
- conda install keras-gpu=2.2.4
- conda install scikit-image=0.15.0
- conda install Pillow=6.1.0
- conda install fastai=1.0.54
- conda install pytorch=1.1.0
- conda install libtiff=4.0.10
- Once all the necessary Python modules have been installed, run the proswap batch script to swap the default Python 3.6 environment used by the raster analysis service to the new environment. Type the command, .\proswap.bat -n DeepLearningEnv.
- Repeat steps 3 through 7 on each machine in your ArcGIS Image Server site.
- Restart your ArcGIS Image Server for Raster Analysis after the deep learning python packages are successfully installed.
Add support for deep learning to a Linux raster analytics deployment
Once you've configured your raster analytics deployment, follow the steps below to install the deep learning Python resources in a Linux environment. If you have a multinode ArcGIS Image Server site, repeat these steps on each server node.
The OS account you use for these steps must be the service account for ArcGIS Image Server.
- If you'll use GPUs for your deep learning raster analytics workflow, install the appropriate NVIDIA GPU drivers.
- Open a terminal as the user who installed ArcGIS Image Server.
- Run the commands below for deep learning raster analytics workflows. First, you will clone a new Python environment from the default Python environment arcgispro-py3. Then you will switch to the cloned Python environment and install all the required deep learning libraries.
- source /<ArcGIS install directory>/server/framework/etc/arcenv
- unset LD_PRELOAD
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" create --name DeepLearningEnv --clone arcgispro-py3
You can specify new deep learning Python environment name, such as “DeepLearningEnv”
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" proswap -n DeepLearningEnv
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install tensorflow-gpu=1.14.0
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install keras-gpu=2.2.4
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install scikit-image=0.15.0
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install Pillow=6.1.0
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install fastai=1.0.54
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install pytorch=1.1.0
- wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install libtiff=4.0.10
- Repeat step 3 on each machine in your ArcGIS Image Server site.
- Restart your ArcGIS Image Server for Raster Analysis after the deep learning python packages are successfully installed.
Utilizing GPUs
In 10.8, multiple service instances can use the GPU on each server node. The maximum number of instances per machine of the RasterProcessingGPU service should be set based on the number of GPU cards installed and intended for deep learning computation on each machine, the default is set to 1.
Caution:
Do not increase the maximum number of instances per machine for this service if there is only one GPU card per machine.Verify the values for minimum and maximum number of instances in ArcGIS Server Manager. Navigate to Services > Manage Services > RasterProcessingGPU, then click on RasterProcessingGPU to go to the editing page. Under the Pooling tab and verify the values for minimum and maximum number of instances. The default minimum and maximum number of instances per machine is 1. To utilize multiple GPUs per machine, the maximum number of instances per machine should be modified to be equal to the number of GPU cards installed per machine. For example, if each server machine has two GPUs, the maximum number of instances per machine should be changed into 2. Click Save and Restart for the change to be effective.
The minimum number of instances per machine of the RasterProcessingGPU service is set to 1 as the default. If there is only one GPU card available for each server node, you may need to restart RasterProcessingGPU service if you want to run model inferences sequentially across different deep learning frameworks. For example, submit the first job for TensorFlow model inference, once it is finished, restart the RasterProcessingGPU service, then submit the second job for PyTorch model inference.
Each request in your deep learning raster analytics workflows includes a processorType environment parameter. Ensure that this parameter correctly specifies whether to use CPU or GPU when making requests. The processorType environment parameter is set in the tool or raster function interface in ArcGIS Pro, Map Viewer, ArcGIS REST API, or ArcGIS API for Python.