d-li14 / involution

[CVPR 2021] Involution: Inverting the Inherence of Convolution for Visual Recognition, a brand new neural operator
https://arxiv.org/abs/2103.06255
MIT License
1.31k stars 177 forks source link

在使用involution的时候发生了错误 #12

Closed aidarikako closed 3 years ago

aidarikako commented 3 years ago

因为想把involution用在其他的网络里面尝试,所以只是单独复制了项目中的involution_cuda.py,然后引用其中的involution类。 但是使用过程中发现如下错误,恳请作者帮忙看一看什么原因导致的错误。 在项目中如下文件中的27行报错:

det/mmdet/models/utils/involution_cuda.py  #文件

kernel_code = cupy.cuda.compile_with_cache(code)  #报错代码

我的配置是python3.7,CUDA9.1,安装的cupy-cuda91,下图是完整报错信息(忽略xxx..,这个算是手动打码)

File "xxx../lib/models/involution_cuda.py", line 281, in forward
    out = _involution_cuda(x, weight, stride=self.stride, padding=(self.kernel_size-1)//2)
File "xxx../lib/models/involution_cuda.py", line 238, in _involution_cuda
    out = _involution.apply(input, weight, _pair(stride), _pair(padding), _pair(dilation))
File "xxx../lib/models/involution_cuda.py", line 170, in forward
    pad_h=padding[0], pad_w=padding[1])
File "cupy/util.pyx", line 81, in cupy.util.memoize.decorator.ret
File "xxx../lib/models/involution_cuda.py", line 27, in load_kernel
    kernel_code = cupy.cuda.compile_with_cache(code)
File "xxx../anaconda3/envs/python37/lib/python3.7/site-packages/cupy/cuda/compiler.py", line 298, in compile_with_cache
    extra_source, backend)
File "xxx../anaconda3/envs/python37/lib/python3.7/site-packages/cupy/cuda/compiler.py", line 352, in _compile_with_cache_cuda
    ls.add_ptr_data(ptx, 'cupy.ptx')
File "cupy/cuda/function.pyx", line 230, in cupy.cuda.function.LinkState.add_ptr_data
File "cupy/cuda/function.pyx", line 232, in cupy.cuda.function.LinkState.add_ptr_data
File "cupy/cuda/driver.pyx", line 198, in cupy.cuda.driver.linkAddData
File "cupy/cuda/driver.pyx", line 118, in cupy.cuda.driver.check_status
cupy.cuda.driver.CUDADriverError: CUDA_ERROR_INVALID_PTX: a PTX JIT compilation failed
d-li14 commented 3 years ago

Maybe it helps https://github.com/cupy/cupy/issues/2188

aidarikako commented 3 years ago

Maybe it helps cupy/cupy#2188

虽然试了一下没起到作用,不过还是感谢您的回答,谢谢,我重新安装环境之后现在可以使用了。