Unable to install Pytorch on windows 10

Prasad: <p>I am trying to install pytorch on Windows 10 using the below code</p>
<p><em>conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch</em></p>
<p>But I am getting the below shared error</p>
<p><em>(base) C:\Users\dalvi&gt;conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch<br>
Collecting package metadata (current_repodata.json): done<br>
Solving environment: failed with initial frozen solve. Retrying with flexible solve.<br>
Collecting package metadata (repodata.json): done<br>
Solving environment: failed with initial frozen solve. Retrying with flexible solve.<br>
Solving environment: /<br>
Found conflicts! Looking for incompatible packages.<br>
This can take several minutes.  Press CTRL-C to abort.</em></p>
<p>It is causing conflict</p>
<p>Below is the Cudatoolkit version<br>
Name - cudatoolkit<br>
Version - 9.0<br>
Build - 1<br>
Channel - anaconda</p>
<p>Below is the Cudnn version<br>
Name - cudnn<br>
Version - 7.6.0<br>
Build - cuda9.0_0</p>
<p>I am Nvidia GeForce RTX 3050 on my laptop.</p>
<p>Please let me know where am I going wrong.</p>

ptrblck: <p>The 3050 would need CUDA&gt;11, so you should use:</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge
</code></pre>
<p>If that’s also creating conflicts in your environment, create a new one and try to reinstall it there.</p>

Prasad: <h2>
<a name="thanks-for-your-response-i-have-created-a-new-environment-and-it-did-worked-but-now-when-i-am-trying-to-built-a-model-using-pretrained-resnet152-to-classify-images-as-dog-or-cat-i-am-getting-the-below-shared-error-1" class="anchor" href="#thanks-for-your-response-i-have-created-a-new-environment-and-it-did-worked-but-now-when-i-am-trying-to-built-a-model-using-pretrained-resnet152-to-classify-images-as-dog-or-cat-i-am-getting-the-below-shared-error-1"></a>Thanks for your response. I have created a new environment and it did worked. But now when I am trying to built a model using pretrained resnet152 to classify images as dog or cat, I am getting the below shared error</h2>
<p>RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR<br>
You can try to repro this exception using the following code snippet. If that doesn’t trigger the error, please include your original repro script when reporting this issue.</p>
<p>import torch<br>
torch.backends.cuda.matmul.allow_tf32 = True<br>
torch.backends.cudnn.benchmark = True<br>
torch.backends.cudnn.deterministic = False<br>
torch.backends.cudnn.allow_tf32 = True<br>
data = torch.randn([8, 3, 224, 224], dtype=torch.float, device=‘cuda’, requires_grad=True)<br>
net = torch.nn.Conv2d(3, 64, kernel_size=[7, 7], padding=[3, 3], stride=[2, 2], dilation=[1, 1], groups=1)<br>
net = net.cuda().float()<br>
out = net(data)<br>
out.backward(torch.randn_like(out))<br>
torch.cuda.synchronize()</p>
<p>ConvolutionParams<br>
data_type = CUDNN_DATA_FLOAT<br>
padding = [3, 3, 0]<br>
stride = [2, 2, 0]<br>
dilation = [1, 1, 0]<br>
groups = 1<br>
deterministic = false<br>
allow_tf32 = true<br>
input: TensorDescriptor 000001EEFAEB3EB0<br>
type = CUDNN_DATA_FLOAT<br>
nbDims = 4<br>
dimA = 8, 3, 224, 224,<br>
strideA = 150528, 50176, 224, 1,<br>
output: TensorDescriptor 000001EEFAEB3F20<br>
type = CUDNN_DATA_FLOAT<br>
nbDims = 4<br>
dimA = 8, 64, 112, 112,<br>
strideA = 802816, 12544, 112, 1,<br>
weight: FilterDescriptor 000001EEF64CF9E0<br>
type = CUDNN_DATA_FLOAT<br>
tensor_format = CUDNN_TENSOR_NCHW<br>
nbDims = 4<br>
dimA = 64, 3, 7, 7,<br>
Pointer addresses:<br>
input: 0000000505400000<br>
output: 0000000560400000<br>
weight: 000000054F3E9000</p>
<p>Can you tell me where am I going wrong?</p>

ptrblck: <p>This might be a cuDNN issue. I assume you are using the <code>torchvision.models.resnet152</code> with an input shape of <code>[8, 3, 224, 224]</code> and are using the latest PyTorch release?<br>
If so, I’ll try to find a similar device and try to reproduce it.</p>

Prasad: <p>Yes I am using <code>torchvision.models.resnet152</code> with an input shape of [<code>8, 3, 224, 224</code>]. I am not sure when you say latest Pytorch release? I have installed pytorch using <code>conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge</code> which you have shared above so I am assuming the latest release.</p>
<p>Also now I am getting the below shared error now.</p>
<p><code>RuntimeError: CUDA out of memory. Tried to allocate 1.10 GiB (GPU 0; 4.00 GiB total capacity; 518.64 MiB already allocated; 1.73 GiB free; 564.00 MiB reserved in total by PyTorch)</code></p>
<p>Request your help on this as well</p>

ptrblck: <p>Thanks for the update. Could you lower the memory requirement, as you are apparently running out of memory and cuDNN might just be running into a sticky error?</p>

Prasad: <p>How do I lower the memory requirement? Should I decrease the batch size?</p>

ptrblck: <p>Yes, decreasing the batch size would be a simple way to decrease the memory usage.<br>
Another way could be to use e.g <code>torch.utils.checkpoint</code> to trade compute for memory or, if possible, decrease the spatial size of the inputs etc. (but this depends on the model).</p>