Esri / deep-learning-frameworks

Installation support for Deep Learning Frameworks for the ArcGIS System
430 stars 105 forks source link

Error when running BDCN_EDGEDETECTOR model type. #41

Closed aidos2 closed 3 months ago

aidos2 commented 2 years ago

Hello I came across with an error when running BDCN_Edge detector model type. My project aims to delineate agricultural fields boundary. Input data is Sentinel 2. My step of creating edge detection is started with exporting training data as classified tiles (parameters chip_size= 400, batch_size=2 ). Then I followed with Train Deep Learning (model = BDCN EDGE, backbone= VGG 19, epoch = 25). When I run this step I stopped with an error below. I guess here ArcgisPro downloaded VGG16 backbone successfully. 100%|██████████| 548M/548M [08:07<00:00, 1.18MB/s] Traceback (most recent call last): File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 378, in execute() File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 375, in execute torch.cuda.empty_cache() File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torch\cuda\memory.py", line 114, in empty_cache torch._C._cuda_emptyCache() RuntimeError: CUDA error: unknown error Please any advice welcome!!!

scdub commented 2 years ago

@aidos2 were you able to address your issue? Can you share what GPU you're working with? it sounds like potentially the GPU memory has been exceeded with this particular model.

scdub commented 2 years ago

@aidos2 Checking in with you again if you were able to address this issue with th particular model. If not, let us know what GPU you're working with and whether reducing the batch size is sufficient to address the problem.

aidos2 commented 2 years ago

Hello. I have checked my GPU memory is 6 GB image

aidos2 commented 2 years ago

Also. I have a question. What kind of model is the best and efficiently delineate agricultural croplands for large regions. I have read several articles about it and I realized there several techniques such as Vanilla Unit with Resnet backbone and edge detection methods with canny edge detection can do this task. Here in the ArcgisPro environment, I used the MaskRCNN model. Hence, my output model is not accurately define crop boundary. My goal is to implement this workflow.

  1. Load Sentinel 2 Mosaic images for the whole region
  2. Load Training data as shapefile
  3. Export training data into Deep Learning
  4. Train Deep Learning models such as UNET, MaskRSNN, BDCN edge detection model
  5. Predict the model for the entire raster
  6. Extract Cropland boundary
  7. Post Processing the vector data such as Generalize( snake or Chaiken)
  8. Compare with Reference Parcel Data and determine differences.