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

I am trying to run this code:

However I get the following error:

(base) mona@mona:~/research/3danimals/SMALViewer$ python 
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 "", line 13, in <module>
  File "", line 6, in main
    main_window = pyqt_viewer.MainWindow()
  File "/home/mona/research/3danimals/SMALViewer/", line 50, in __init__
  File "/home/mona/research/3danimals/SMALViewer/", line 219, in setup_ui
  File "/home/mona/research/3danimals/SMALViewer/", 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/", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mona/research/3danimals/SMALViewer/smal/", line 40, in forward
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/nn/modules/", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mona/research/3danimals/SMALViewer/SMPL/", 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/", 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/", 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].

I have:

$ 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.
>>> import torch
>>> torch.__version__
>>> torch.version.cuda
>>> torch.cuda.is_available()

$ 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

This issue was tracked here and should be already fixed.
Could you update to the latest stable PyTorch version and rerun the code, please?

1 Like

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.

The latest stable PyTorch version is 1.6.0 and you can find the install commands for the conda binaries or pip wheels here. 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).
You can see the compatibility here.

1 Like