STTran icon indicating copy to clipboard operation
STTran copied to clipboard

ImportError: cannot import name '_C' from 'fasterRCNN.lib.model' (/home/k/kajal/STTran/fasterRCNN/lib/model/__init__.py)

Open kajal15003 opened this issue 1 year ago • 7 comments

Please help

kajal15003 avatar May 03 '23 06:05 kajal15003

I guess you didn't compile the C++ code (correctly). Please run the setup.py.

Btw, I think the code only supports the cuda version<11.1.

yrcong avatar May 04 '23 10:05 yrcong

Do you solve this problem? My cuda version is 11.8 and I also met this problem.

AlphaGoooo avatar May 12 '23 13:05 AlphaGoooo

Do you solve this problem? My cuda version is 11.8 and I also met this problem.

I think the exclusive solution is using cuda<=11.0 and GPU<2080Ti

yrcong avatar May 12 '23 20:05 yrcong

I have downgraded the cuda version. But it is still showing the same error

kajal15003 avatar May 15 '23 03:05 kajal15003

Have you compiled the code again after downgrading the cuda version?

yrcong avatar May 15 '23 19:05 yrcong

Yes, it is showing the below one in the output running build_ext

kajal15003 avatar May 16 '23 05:05 kajal15003

我也遇到了这个问题,断断续续搞了三天进行了很多操作,不确定哪步起的作用,大概逻辑是:

  1. 作者提供了fasterRCNN/lib/build文件,里面明明有我们要的‘_C’文件,并且报错中的fasterRCNN/lib/model/里也有却找不到; 都说版本不对,我设置了很多搭配:成功的是CUDA10.0+pytorch1.1,由于我是Ubuntu22.04安装CUDA10.0相当费劲,经历了GCC降级等,最后我这边整成了多版本CUDA(因为之前别的程序使用高版本,我怕捡了芝麻丢了西瓜)
  2. 改完版本以后能找到了,但是报错‘_C’文件里少东西,了解了一下是因为‘_C’文件是这个作者提供的,我们应该自己运行一下,于是我去到fasterRCNN/lib目录运行python setup.py build_ext --inplace,生成自己的‘_C’文件在对应位置,解决了就

CL2LC avatar Jun 12 '24 08:06 CL2LC