RuntimeError: Could not run 'aten::conj.out' with arguments from the 'CUDATensorId' backend. 'aten::conj.out' is only available for these backends: [CPUTensorId, VariableTensorId]

Mona_Jalal: <p>I am trying to run this code: <a href="https://github.com/benjiebob/SMALViewer" rel="nofollow noopener">https://github.com/benjiebob/SMALViewer</a></p>
<p>However I get the following error:</p>
<pre><code class="lang-auto">(base) mona@mona:~/research/3danimals/SMALViewer$ python smal_viewer.py 
dict_keys(['f', 'J_regressor', 'kintree_table', 'weights', 'posedirs', 'v_template', 'shapedirs'])
torch.Size([4, 3889])
 Tensor J_regressor shape:  torch.Size([37, 3889])
 Tensor weights shape:  torch.Size([3889, 33])
 Tensor posedirs shape:  torch.Size([3889, 3, 288])
 Tensor v_template shape:  torch.Size([3889, 3])
 Tensor shapedirs shape:  torch.Size([3889, 3, 41])
 Tensor faces shape:  torch.Size([7774, 3])
Traceback (most recent call last):
  File "smal_viewer.py", line 13, in &lt;module&gt;
    main()
  File "smal_viewer.py", line 6, in main
    main_window = pyqt_viewer.MainWindow()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 50, in __init__
    self.setup_ui()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 219, in setup_ui
    self.update_render()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 241, in update_render
    rendered_images, rendered_silhouettes, rendered_joints, verts, joints_3d = self.model_renderer(self.smal_params)
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mona/research/3danimals/SMALViewer/smal/smal3d_renderer.py", line 40, in forward
    batch_params['trans'])
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mona/research/3danimals/SMALViewer/SMPL/smal_torch_batch.py", line 157, in forward
    R_cube_big = self.rodrigues(pose.view(-1, 1, 3)).reshape(batch_num, -1, 3, 3)
  File "/home/mona/research/3danimals/SMALViewer/SMPL/smal_torch_batch.py", line 57, in rodrigues
    theta = torch.norm(r + eps, dim=(1, 2), keepdim=True)  # dim cannot be tuple
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/functional.py", line 755, in norm
    return torch._C._VariableFunctions.frobenius_norm(input, dim, keepdim=keepdim)
RuntimeError: Could not run 'aten::conj.out' with arguments from the 'CUDATensorId' backend. 'aten::conj.out' is only available for these backends: [CPUTensorId, VariableTensorId].
</code></pre>
<p>I have:</p>
<pre><code class="lang-auto">
$ python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.__version__
'1.4.0'
&gt;&gt;&gt; torch.version.cuda
'10.1'
&gt;&gt;&gt; torch.cuda.is_available()
True

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal


</code></pre>

ptrblck: <p>This issue was tracked <a href="https://github.com/pytorch/pytorch/issues/30704">here</a> and should be already fixed.<br>
Could you update to the latest stable PyTorch version and rerun the code, please?</p>

Mona_Jalal: <p>Hi Piotr, could you please let me know what is the latest stable version of PyTorch for Ubuntu 20.04 and if there is a link for downloading it? Thanks for your reply.</p>

ptrblck: <p>The latest stable PyTorch version is <code>1.6.0</code> and you can find the install commands for the conda binaries or pip wheels <a href="https://pytorch.org/get-started/locally/">here</a>. I would recommend to use the latest CUDA version (10.2), but make sure your driver supports it (you are currently using 10.1 so you might use an older driver).<br>
You can see the compatibility <a href="https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver">here</a>.</p>