CUDA error:invalid argument

蔚落 2022-10-09 03:28 341阅读 0赞

当使用torch.view()时


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

可以使用 tensor.contiguous() 解决

比如:

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

不能解决问题

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.

这个还没试

发表评论

表情:
评论列表 (有 0 条评论,341人围观)

还没有评论,来说两句吧...

相关阅读

    相关 cuda安装(cuda安装教程)

    directx9.0c怎么安装 要安装两次,第一次就是你截图的那个,安装在哪随意,随便找个盘建个文件夹,安装到里面,你安装后,点开安装后的文件夹,里面有好多压缩包什么的,

    相关 arguments

    arguments对象是所有函数中可用的局部变量。你可以使用arguments对象在函数中引用函数的参数。此对象包含传递给函数的每个参数的条目,第一个条目的索引从0开始。例如,

    相关 arguments

    arguments JavaScript还有一个免费赠送的关键字`arguments`,它只在函数内部起作用,并且永远指向当前函数的调用者传入的所有参数。`argumen