Getting the following error. how can i solve this error?

awais19999: <p>2023-11-29 11:01:06.577786: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered<br>
2023-11-29 11:01:06.577851: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered<br>
2023-11-29 11:01:06.577893: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered<br>
2023-11-29 11:01:07.971136: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT<br>
11:01:09 - INFO: Starting epoch 0:<br>
100% 210/210 [03:56&lt;00:00,  1.13s/it, MSE=0.239]<br>
11:05:05 - INFO: Sampling 10 new images…<br>
0it [00:00, ?it/s]…/aten/src/ATen/native/cuda/Indexing.cu:1239: indexSelectSmallIndex: block: [0,0,0], thread: [0,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
…/aten/src/ATen/native/cuda/Indexing.cu:1239: indexSelectSmallIndex: block: [0,0,0], thread: [1,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
…/aten/src/ATen/native/cuda/Indexing.cu:1239: indexSelectSmallIndex: block: [0,0,0], thread: [2,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
…/aten/src/ATen/native/cuda/Indexing.cu:1239: indexSelectSmallIndex: block: [0,0,0], thread: [3,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed…<br>
0it [00:00, ?it/s]<br>
Traceback (most recent call last):<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/ddpm_conditional.py”, line 128, in <br>
launch()<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/ddpm_conditional.py”, line 124, in launch<br>
train(args)<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/ddpm_conditional.py”, line 102, in train<br>
sampled_images = diffusion.sample(model, n=len(labels), labels=labels)<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/ddpm_conditional.py”, line 48, in sample<br>
predicted_noise = model(x, t, labels)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl<br>
return self._call_impl(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/modules.py”, line 234, in forward<br>
x1 = self.inc(x)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl<br>
return self._call_impl(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/content/drive/MyDrive/Diffusion-Models-pytorch/modules.py”, line 76, in forward<br>
return self.double_conv(x)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl<br>
return self._call_impl(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/container.py”, line 215, in forward<br>
input = module(input)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl<br>
return self._call_impl(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py”, line 460, in forward<br>
return self._conv_forward(input, self.weight, self.bias)<br>
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py”, line 456, in _conv_forward<br>
return F.conv2d(input, weight, bias, self.stride,<br>
RuntimeError: GET was unable to find an engine to execute this computation</p>

ptrblck: <p>An indexing operation is failing:</p>
<pre data-code-wrap="python"><code class="lang-python">…/aten/src/ATen/native/cuda/Indexing.cu:1239: indexSelectSmallIndex: block: [0,0,0], thread: [0,0,0] Assertion srcIndex &lt; srcSelectDimSize failed.
</code></pre>
<p>Rerun the code via <code>CUDA_LAUNCH_BLOCKING=1 python script.py args</code> to narrow down which indexing op fails and fix it.</p>

awais19999: <p>thank you sir for the quick response<br>
root@09622d7731fa:/workspace/Diffusion-Models-pytorch-main# CUDA_LAUNCH_BLOCKING=1 python ddpm_conditional.py args<br>
usage: ddpm_conditional.py [-h]<br>
ddpm_conditional.py: error: unrecognized arguments: args.<br>
but when i run without args it give me this</p>
<p>root@09622d7731fa:/workspace/Diffusion-Models-pytorch-main# CUDA_LAUNCH_BLOCKING=1 python ddpm_conditional.py<br>
02:57:52 - INFO: Starting epoch 0:<br>
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 1050/1050 [03:55&lt;00:00,  4.47it/s, MSE=0.0154]<br>
03:01:47 - INFO: Sampling 10 new images…<br>
0it [00:00, ?it/s]/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [0,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [1,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [2,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [3,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [4,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [5,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [6,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [7,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [8,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [9,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [10,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed.<br>
/opt/conda/conda-bld/pytorch_1682343967769/work/aten/src/ATen/native/cuda/Indexing.cu:1093: indexSelectSmallIndex: block: [1,0,0], thread: [11,0,0] Assertion <code>srcIndex &lt; srcSelectDimSize</code> failed. and so on at the end:</p>
<p>File “/workspace/Diffusion-Models-pytorch-main/ddpm_conditional.py”, line 128, in <br>
launch()<br>
File “/workspace/Diffusion-Models-pytorch-main/ddpm_conditional.py”, line 124, in launch<br>
train(args)<br>
File “/workspace/Diffusion-Models-pytorch-main/ddpm_conditional.py”, line 102, in train<br>
sampled_images = diffusion.sample(model, n=len(labels), labels=labels)<br>
File “/workspace/Diffusion-Models-pytorch-main/ddpm_conditional.py”, line 48, in sample<br>
predicted_noise = model(x, t, labels)<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 1501, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/workspace/Diffusion-Models-pytorch-main/modules.py”, line 232, in forward<br>
t += self.label_emb(y)<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 1501, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/modules/sparse.py”, line 162, in forward<br>
return F.embedding(<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/functional.py”, line 2210, in embedding<br>
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)<br>
RuntimeError: CUDA error: device-side assert triggered<br>
Compile with <code>TORCH_USE_CUDA_DSA</code> to enable device-side assertions.</p>

ptrblck: <aside class="quote no-group" data-username="awais19999" data-post="3" data-topic="192791">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/35a633/48.png" class="avatar"> awais19999:</div>
<blockquote>
<p>File “/workspace/Diffusion-Models-pytorch-main/modules.py”, line 232, in forward<br>
t += self.label_emb(y)<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 1501, in _call_impl<br>
return forward_call(*args, **kwargs)<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/modules/sparse.py”, line 162, in forward<br>
return F.embedding(<br>
File “/opt/conda/lib/python3.10/site-packages/torch/nn/functional.py”, line 2210, in embedding<br>
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)<br>
RuntimeError: CUDA error: device-side assert triggered</p>
</blockquote>
</aside>
<p>This embedding operation is failing so your <code>input</code> tensor contains values out-of-bounds for this embedding lookup table.</p>