Example fails on GPU
See original GitHub issueWhen running the example from the README:
from soft_dtw_cuda import SoftDTW
import torch
# Create the sequences
batch_size, len_x, len_y, dims = 8, 15, 12, 5
x = torch.rand((batch_size, len_x, dims), requires_grad=True)
y = torch.rand((batch_size, len_y, dims))
# Create the "criterion" object
sdtw = SoftDTW(use_cuda=True, gamma=0.1)
# Compute the loss value
loss = sdtw(x, y) # Just like any torch.nn.xyzLoss()
# Aggregate and call backward()
loss.mean().backward()
I get a TypeError:
Traceback (most recent call last):
File "test_dtw.py", line 10, in <module>
loss = sdtw(x, y) # Just like any torch.nn.xyzLoss()
File "/home/dockeruser/env/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/dockeruser/soft_dtw_cuda.py", line 352, in forward
return func_dtw(D_xy, self.gamma, self.bandwidth)
File "/home/dockeruser/soft_dtw_cuda.py", line 140, in forward
compute_softdtw_cuda[B, threads_per_block](cuda.as_cuda_array(D.detach()),
File "/home/dockeruser/env/lib/python3.7/site-packages/numba/cuda/api.py", line 74, in as_cuda_array
raise TypeError("*obj* doesn't implement the cuda array interface.")
TypeError: *obj* doesn't implement the cuda array interface.
Potentially relevant packages from my env: Cython 0.29.24 numba 0.54.0 torch 1.6.0
Any suggestions?
BTW. Thanks a lot for porting to cuda!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Fix Graphics Card Error and Video Issues?
Part 2. How to Fix Graphics Card Errors · 1. Cool Down the Temperature · 2. Update The Drivers · 3. Is Your...
Read more >What are the most common reasons for GPU cards to fail?
Poor education on what it takes to make a successful marriage. · Poor selection of spouses, where people ignore major incompatibilties, have unrealistic ......
Read more >examples\imagenet\models_test.py fails on GPU (8 x Titan-m)
Problem you have encountered: Running flax\examples\imagenet\models_test.py hits runtime error. What you expected to happen: Test to exit ...
Read more >5 Signs Your Graphics Card Has Problems and May Be Dying
Video cards can fail for so many different reasons. Not properly installing the component in the computer can lead to video card failure,...
Read more >Flux Pendulum DDPG example fails on GPU - Julia Discourse
It seems to work on my CPU but on the GPU get a weird error which seems to be related to CUDA.jl not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also encountered. However, after inserting two lines before
sdtw = SoftDTW(use_cuda=True, gamma=0.1)
, I can run this example.#17 is now merged. Closing this issue.