torch implementation in R does not fit a CNN model

21 views Asked by At

I followed the Get started section in the torch official website, but after running the fit() command I get the following error:

fitted <- net |> 
  setup(
    loss = function(y_hat, y_true) nnf_mse_loss(y_hat, y_true$unsqueeze(2)),
    optimizer = optim_adam
  ) |> 
  fit(train_dl, epochs = 10, valid_data = valid_dl)
Error in (function (self, inputs, gradient, retain_graph, create_graph)  : 
  GET was unable to find an engine to execute this computation
Exception raised from run_single_conv at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cudnn\Conv_v8.cpp:671 (most recent call first):
00007FF8BEF0D24200007FF8BEF0D1E0 c10.dll!c10::Error::Error [<unknown file> @ <unknown line number>]
00007FF8BEF0CE1A00007FF8BEF0CDC0 c10.dll!c10::detail::torchCheckFail [<unknown file> @ <unknown line number>]
00007FFFC06CF33A00007FFFC06A5940 torch_cuda.dll!at::native::cudnn_convolution_transpose [<unknown file> @ <unknown line number>]
00007FFFC06CD43B00007FFFC06A5940 torch_cuda.dll!at::native::cudnn_convolution_transpose [<unknown file> @ <unknown line number>]
00007FFFC06A4DC000007FFFC06A3BD0 torch_cuda.dll!at::native::cudnn_convolution_add_relu [<unknown file> @ <unknown line number>]
00007FFFC06A45BA00007FFFC06A3BD0 torch_cuda.dll!at::native::cudnn_convolution_add_relu [<unknown file> @ <unknown line number>]
00007FF80CEB0CDF00007FF80CEAFFA0

I have checked that both nvidia-smi and nvcc --version return the same CUDA version (11.8), as this stackoverflow first answer suggests.

How to fix this error?

0

There are 0 answers