<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Deep Learning torch.cuda.OutOfMemoryError: CUDA out of memory. in ArcGIS Image Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1580498#M799</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/814733"&gt;@PPRTDUA&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Generally, out-of-memory issues occur when the batch size exceeds your GPU's capacity. Could you try running the tool with a lower batch size and check if any other processes are utilizing the GPU on your machine?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 17:17:43 GMT</pubDate>
    <dc:creator>ShivaniPathak</dc:creator>
    <dc:date>2025-01-30T17:17:43Z</dc:date>
    <item>
      <title>Deep Learning torch.cuda.OutOfMemoryError: CUDA out of memory.</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1572655#M784</link>
      <description>&lt;P&gt;The problem occured when i used the&amp;nbsp;multiresolution-object-detection-with-text-sam, it says error like this, how can i fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting execution&lt;BR /&gt;Clearing CUDA cache...&lt;BR /&gt;CUDA cache cleared.&lt;BR /&gt;'Detect Objects Using Deep Learning' will run 5 times.&lt;BR /&gt;Processing cell size: 0.1&lt;BR /&gt;Processing cell size: 0.15&lt;BR /&gt;Processing cell size: 0.2&lt;BR /&gt;Repairing geometry...&lt;BR /&gt;Geometry repaired.&lt;BR /&gt;Deleting rows with areas &amp;lt; 15 and areas &amp;gt; 4500&lt;BR /&gt;Rows deleted.&lt;BR /&gt;Running Pairwise Buffer...&lt;BR /&gt;Running Pairwise Dissolve...&lt;BR /&gt;Pairwise Dissolve completed.&lt;BR /&gt;Running Spatial Join...&lt;BR /&gt;Spatial Join completed.&lt;BR /&gt;Running Pairwise Dissolve - Mean Confidence...&lt;BR /&gt;Pairwise Dissolve - Mean Confidence completed.&lt;BR /&gt;Running feature classification by area...&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 0.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 0.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 0.5 completed.&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 1...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 1...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 1 completed.&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 1.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 1.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 1.5 completed.&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 2.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 2.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 2.5 completed.&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 3.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 3.5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 3.5 completed.&lt;BR /&gt;Running Regularizing Rectangular Footprints with tolerance 5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 5...&lt;BR /&gt;Regularizing Rectangular Footprints with tolerance 5 completed.&lt;BR /&gt;Deleting temporary outputs...&lt;BR /&gt;Temporary outputs deleted.&lt;BR /&gt;Running Merge...&lt;BR /&gt;Running Merge for ['C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_50', 'C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_100', 'C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_150', 'C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_250', 'C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_350', 'C:\\Users\\USER\\Documents\\ArcGIS\\Projects\\Kerja Kerja Kerja\\Kerja Kerja Kerja.gdb\\sds_20_500']...&lt;BR /&gt;Merge completed.&lt;BR /&gt;Processing cell size: 0.25&lt;BR /&gt;Processing extent: 1435233,7007148 9426028,69129479 1435778,57441159 9426483,61758766 PROJCS["DGN_1995_UTM_Zone_49S",GEOGCS["GCS_DGN_1995",DATUM["D_Datum_Geodesi_Nasional_1995",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",111.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]&lt;BR /&gt;Detecting objects using deep learning...&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 371, in execute&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\Functions.py", line 4197, in DetectObjectsUsingDeepLearning&lt;BR /&gt;return Wrapper(&lt;BR /&gt;^^^^^^^^&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 45, in swapper&lt;BR /&gt;result = wrapper(*args, **kwargs)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\Functions.py", line 4182, in Wrapper&lt;BR /&gt;result = arcpy.gp.DetectObjectsUsingDeepLearning_ia(&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 532, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;arcgisscripting.ExecuteError: A raster error has occurred. The messages that follow will provide more detail.&lt;BR /&gt;Python raster function is unable to vectorize the data. [Failed to generate table]&lt;BR /&gt;Python raster function is unable to vectorize the data.&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\USER\AppData\Local\Temp\ArcGISProTemp9596\TextSAM.dlpk\TextSAM.py", line 476, in vectorize&lt;BR /&gt;masks, _, _ = self.mask_generator.predict_torch(&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context&lt;BR /&gt;return func(*args, **kwargs)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Users\USER\AppData\Local\Temp\ArcGISProTemp9596\TextSAM.dlpk\segment-anything\segment_anything\predictor.py", line 229, in predict_torch&lt;BR /&gt;low_res_masks, iou_predictions = self.model.mask_decoder(&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl&lt;BR /&gt;return forward_call(*args, **kwargs)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Users\USER\AppData\Local\Temp\ArcGISProTemp9596\TextSAM.dlpk\segment-anything\segment_anything\modeling\mask_decoder.py", line 94, in forward&lt;BR /&gt;masks, iou_pred = self.predict_masks(&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Users\USER\AppData\Local\Temp\ArcGISProTemp9596\TextSAM.dlpk\segment-anything\segment_anything\modeling\mask_decoder.py", line 127, in predict_masks&lt;BR /&gt;src=src + dense_prompt_embeddings&lt;BR /&gt;~~~~^~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 10.60 GiB (GPU 0; 6.00 GiB total capacity; 11.87 GiB already allocated; 0 bytes free; 11.94 GiB reserved in total by PyTorch) If reserved memory is &amp;gt;&amp;gt; allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF&lt;BR /&gt;Python Raster Function's .vectorize() method returned nothing.&lt;BR /&gt;Failed to execute (DetectObjectsUsingDeepLearning).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Failed to execute (MultiScaleDL).&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 10:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1572655#M784</guid>
      <dc:creator>PPRTDUA</dc:creator>
      <dc:date>2025-01-05T10:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deep Learning torch.cuda.OutOfMemoryError: CUDA out of memory.</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1580498#M799</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/814733"&gt;@PPRTDUA&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Generally, out-of-memory issues occur when the batch size exceeds your GPU's capacity. Could you try running the tool with a lower batch size and check if any other processes are utilizing the GPU on your machine?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 17:17:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1580498#M799</guid>
      <dc:creator>ShivaniPathak</dc:creator>
      <dc:date>2025-01-30T17:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Deep Learning torch.cuda.OutOfMemoryError: CUDA out of memory.</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1583952#M809</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/814733"&gt;@PPRTDUA&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;There could be multiple ways to avoid that error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/485093"&gt;@ShivaniPathak&lt;/a&gt;&amp;nbsp; suggested please try to decrease your batch size&lt;/P&gt;&lt;P&gt;2- I would try to run the tool with less resolutions or a smaller extent. Currently I see that you are processing 4 different resolutions and that could be utilizing lots of gpu memory.&lt;/P&gt;&lt;P&gt;Also what version of ArcGIS Pro are you currently running?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 12:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/deep-learning-torch-cuda-outofmemoryerror-cuda-out/m-p/1583952#M809</guid>
      <dc:creator>Rami-Alouta</dc:creator>
      <dc:date>2025-02-11T12:15:24Z</dc:date>
    </item>
  </channel>
</rss>

