<?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: How force Pytorch to use CPU instead of GPU? in ArcGIS Image Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1047338#M160</link>
    <description>&lt;P&gt;Thank you so much! It worked.&lt;/P&gt;&lt;P&gt;I tried upgrading packages on another laptop using a cloned environment and it worked but on this laptop, I couldn't even clone the default environment.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 23:28:19 GMT</pubDate>
    <dc:creator>MaryamBarzegar</dc:creator>
    <dc:date>2021-04-14T23:28:19Z</dc:date>
    <item>
      <title>How force Pytorch to use CPU instead of GPU?</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046738#M156</link>
      <description>&lt;P&gt;Hello, I have a 2GB GPU and it's not enough for training the model and I get CUDA out of memory error every time (when running model.Ir_find ()). Is there any way to force Pytorch to use only CPU? For some reasons I can't clone the default Python environment either and update the ArcGIS API to see I'll get an error in other versions or not. I'm using ArcGIS API 1.8.3.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 05:40:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046738#M156</guid>
      <dc:creator>MaryamBarzegar</dc:creator>
      <dc:date>2021-04-14T05:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: How force Pytorch to use CPU instead of GPU?</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046755#M158</link>
      <description>&lt;P&gt;Obviously I've done that before and none of the solutions worked and that's why I posted my question here. For instance, I tried&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;device = torch.device("cpu")&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and,&lt;/DIV&gt;&lt;DIV&gt;os.environ["CUDA_VISIBLE_DEVICES"] =""&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;both didn't work.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Apr 2021 07:01:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046755#M158</guid>
      <dc:creator>MaryamBarzegar</dc:creator>
      <dc:date>2021-04-14T07:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: How force Pytorch to use CPU instead of GPU?</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046845#M159</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import torch
torch.cuda.is_available = lambda : False
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')&lt;/LI-CODE&gt;&lt;P&gt;It's definitely using CPU on my system as shown in screenshot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, I am also getting an error trying to update the Python API, details here - is it the same for you?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/unable-to-install-upgrade-via-conda-invalidspecerror-invalid/td-p/1044939" target="_blank" rel="noopener"&gt;Unable to install\upgrade via conda: InvalidSpecError: Invalid spec: &amp;gt;=&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 12:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1046845#M159</guid>
      <dc:creator>Tim_McGinnes</dc:creator>
      <dc:date>2021-04-14T12:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How force Pytorch to use CPU instead of GPU?</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1047338#M160</link>
      <description>&lt;P&gt;Thank you so much! It worked.&lt;/P&gt;&lt;P&gt;I tried upgrading packages on another laptop using a cloned environment and it worked but on this laptop, I couldn't even clone the default environment.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 23:28:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/how-force-pytorch-to-use-cpu-instead-of-gpu/m-p/1047338#M160</guid>
      <dc:creator>MaryamBarzegar</dc:creator>
      <dc:date>2021-04-14T23:28:19Z</dc:date>
    </item>
  </channel>
</rss>

