You are on page 1of 3

Lab: Clone the default conda environment in ArcGIS Pro

Lab: Clone the default conda environment


First, you created training samples of coconut palm trees and exported them as
image chips. These training samples can be used to train a model using the Detect
Objects using Deep Learning tool in ArcGIS Pro 2.5, which relies on deep learning
frameworks such as TensorFlow, Keras, or CNTK. To install these deep learning
libraries, you'll clone the default Python environment using the Python Command
Prompt. You can learn more about the ArcGIS Pro Deep Learning toolset and the
process of installing the deep learning frameworks in the documentation.

1. If necessary, save your project and close ArcGIS Pro.


2. On your desktop, search for and run the Python Command Prompt as an administrator.

The Python Command Prompt was downloaded when you installed ArcGIS Pro, so it
automatically runs the propy.bat initialization file. This file, which runs in place of
python.exe, recognizes your application's active conda environment and allows you to run
standalone scripts using that environment.

For this project, you want to create a new environment named deeplearning. The default
environment in ArcGIS Pro is read only, so you'll clone it to make changes.

3. Run the following command to create a new conda environment by cloning the
default ArcGIS Pro environment:

conda create -n deeplearning –-clone arcgispro-py3


The cloning process may take a few minutes. Cloned environments are stored in the envs
folder at %LOCALAPPDATA%\Esri\conda\envs\. The system
variable %LOCALAPPDATA% is a substitute for the
C:\Users\YourUserFolderName\AppData\Local\.

4. After the new environment is created, run the following commands to change your directory
to that folder:

cd C:\Program Files\ArcGIS\Pro\bin\Python\envs\deeplearning

Note:

If your ArcGIS Pro installation is not located in the Program Files folder, you must use your
installation's path instead. There are several default folders that python environments can be
cloned to. These include \AppData\Local\ESRI\conda\envs,
and \ArcGIS\Pro\bin\Python\envs, and may vary depending on the previous active
environment.

5. Run the following command to activate the new environment and update the file path to
match where you stored the cloned environment:

activate deeplearning
This may take a few minutes. When the activation process is finished, the active environment
name appears in parentheses before the folder location. Activating the new environment
specifies that all changes you make occur only in the selected environment. When doing

1
Lab: Clone the default conda environment in ArcGIS Pro

multiple projects that need different packages or different versions of packages, this is
important. Now, you'll install the packages that the arcgis.learn module needs to run.

6. Run the following commands one at a time to install the deep learning package dependencies:
7. conda install tensorflow-gpu=1.14.0
8. conda install keras-gpu=2.2.4
9. conda install scikit-image=0.15.0
10. conda install Pillow=6.1.0
11. conda install fastai=1.0.54
12. conda install pytorch=1.1.0
conda install libtiff=4.0.10 --no-deps

Note:

Some packages will require you to confirm installation. When prompted, type y and
press Enter.

13. Use the command proswap to set the ArcGIS Pro Project Environment to
your deeplearning environment.

proswap deeplearning
You now have a conda environment set up with all the libraries needed for the deep learning
tools to run.

14. Close the command prompt, then reopen your CoconutHealth project.

It is necessary to refresh the project to allow the new environment settings to update. Before
starting the process of training a deep learning model, you'll use the Python Package Manager
to confirm that the deeplearning environment is active in ArcGIS Pro.

15. On the ribbon, click the Project tab and choose Python.

The Python Package Manager opens. Unless you've previously used different environments
within ArcGIS Pro, the default environment, arcgispro-py3, is active. Environments created
and activated in the command prompt are only persisted in that instance of the prompt unless
you also set them as active in ArcGIS Pro.

16. For Project Environment, confirm that the deeplearning environment is active.

2
Lab: Clone the default conda environment in ArcGIS Pro

Now, you'll use the Train Deep Learning Model tool to create an Esri model definition
(.emd) file that is formatted to be read by ArcGIS geoprocessing tools like Detect Objects
Using Deep Learning.

Check your deep learning framework installation:


https://pro.arcgis.com/en/pro-app/tool-reference/image-analyst/install-deep-learning-
frameworks.htm

You might also like