当前位置:网站首页>CUDA error:invalid argument

CUDA error:invalid argument

2021-06-23 23:45:19 Wangqi

When using torch.view() when


appear RuntimeError: invalid argument 1: input is not contiguous at /pytorch/torch/lib/TH/generic/THTensor.c:231

have access to tensor.contiguous() solve

such as :

mask[idx, :].view(bat_size, 1) become mask[idx, :].contiguous().view(bat_size, 1)

Can't solve the problem

https://stackoverflow.com/questions/13994799/cuda-invalid-argument-error-on-second-kernel

cudaLimitMallocHeapSize controls the size in bytes of the heap used by the malloc() and free() device system calls. Setting cudaLimitMallocHeapSize must be performed before launching any kernel that uses the malloc() or free() device system calls, otherwise cudaErrorInvalidValue will be returned. This limit is only applicable to devices of compute capability 2.0 and higher. Attempting to set this limit on devices of compute capability less than 2.0 will result in the error cudaErrorUnsupportedLimit being returned.

I haven't tried this yet

版权声明
本文为[Wangqi]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/06/20210623234449098I.html

随机推荐