Skip To Content

Configure ArcGIS Image Server for deep learning raster analytics

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.

  1. If you want to use GPUs for your deep learning raster analytics workflow, install the appropriate NVIDIA GPU drivers.
  2. 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.
  3. 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.
  4. 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

  5. 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\
  6. 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:
    1. conda install tensorflow-gpu=1.14.0
    2. conda install keras-gpu=2.2.4
    3. conda install scikit-image=0.15.0
    4. conda install Pillow=6.1.0
    5. conda install fastai=1.0.54
    6. conda install pytorch=1.1.0
    7. conda install libtiff=4.0.10
  7. 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.
  8. Repeat steps 3 through 7 on each machine in your ArcGIS Image Server site.
  9. 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.

  1. If you'll use GPUs for your deep learning raster analytics workflow, install the appropriate NVIDIA GPU drivers.
  2. Open a terminal as the user who installed ArcGIS Image Server.
  3. 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.
    1. source /<ArcGIS install directory>/server/framework/etc/arcenv
    2. unset LD_PRELOAD
    3. 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

    4. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" proswap -n DeepLearningEnv
    5. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install tensorflow-gpu=1.14.0
    6. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install keras-gpu=2.2.4
    7. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install scikit-image=0.15.0
    8. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install Pillow=6.1.0
    9. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install fastai=1.0.54
    10. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install pytorch=1.1.0
    11. wine cmd /c "C:/Program Files/arcgis/server/framework/runtime/ArcGIS/bin/Python/Scripts/conda.exe" install libtiff=4.0.10
  4. Repeat step 3 on each machine in your ArcGIS Image Server site.
  5. 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.

Setting up Raster Processing GPU

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.