Show progress/epochs when training deep learning model with model.fit() in arcgis.learn

1243
2
05-22-2023 02:57 AM
kaktuus
New Contributor

Hi,

I'm training a Mask R-CNN to detect tree species on RGB images. For this I'm using arcgis.learn in VS Code and the code you see below in the screenshots. The code runs smoothly on the GPU but takes very long. I guess that is because I have a lot of data and I applied data augmentation. The problem is that I can't see the progress/at which epoch I am. When I look at examples online, I always see that the epochs, train loss, valid loss etc. are displayed after they run the code model.fit(). That is not the case for me, does anyone know what might be the issue?

Also, I set "tensorboard = True" to see the progress but I don't see a "training_log" folder in my dataset-path. I have three different input folders for prepare_data and I checked all of them. When I tried model.fit() with just one input folder for prepare_data, it stored it in the input folder and I could access it via tensorboard. Does anyone know where the "training_log" folder is stored or how I can access it?

Or does anyone have another idea, how I can see the progress/the epochs my model has already trained with model.fit()?

Thanks for all your replies!

0 Kudos
2 Replies
NicholasGiner1
Esri Contributor

@PriyankaTuteja  - please advise.  thanks!

PriyankaTuteja
Esri Contributor

Hi  @kaktuus 

To run any arcgis.learn notebook in the VS Code, you need to ensure that you follow the following steps:

  1. Install Jupyter Extension (Use shortcut: Ctrl+Shift+X to open Extensions window-->Search Jupyter-->Install and enable)
  2. Set Python Interpreter as the Deep Learning Environment.
  3. Run your desired notebook. The output for Fit method should get visible.

Alternatively, if you do not wish to be restricted to VS Code, you could launch Python Command Prompt or Anaconda Prompt (wherever you have created the deep learning environment). Activate the environment, and then type ‘jupyter notebook’. It would launch a localhost, from where you could run notebooks too.

Now, the workflow for detecting trees on RGB images using MaskRCNN sounds like a good idea. I suggest you could also use AutoDL on your data (PascalVOC) and get a recommendation for the best performing Detection model. This can shorten your search criteria and may help provide better results that MaskRCNN.

You will also need to set the cuda device for being able to train models on the GPU. In the first cell of your notebook, run the following:

Import os

os.environ[‘CUDA_VISIBLE_DEVICES’]=”0”

 

When fit method is running, you could open Task Manager and verify the Cuda GPU usage.

For checking the Tensorboard,

'tensorboard --host=<machinename> --logdir="<datapath>\training_log"'

 

 

 

 

 

 

 

0 Kudos