txchen-USTC / MiM-ISTD

Official pytorch code of our paper "MiM-ISTD: Mamba-in-Mamba for Efficient Infrared Small Target Detection"
MIT License
109 stars 11 forks source link

I have a question Expected u.is_cuda() to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.) #14

Closed Rooike111 closed 6 months ago

Rooike111 commented 6 months ago

Expected u.is_cuda() to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.) OMG This question,I can't resolve. can you help me? please

darkmingy commented 6 months ago

Have you solved this problem yet? I'm having the same problem.

Rooike111 commented 6 months ago

Have you solved this problem yet? I'm having the same problem.

OH yes ,put your data on cuda than it can run like this if name == 'main':

input_ = torch.Tensor(5, 3, 256, 256).cuda()
net = MiM([2]*3,[8, 16, 32, 64, 128]).cuda()

out=net(input_)
darkmingy commented 6 months ago

ok, I get it! thanks!