yrcong / STTran

Spatial-Temporal Transformer for Dynamic Scene Graph Generation, ICCV2021
MIT License
187 stars 34 forks source link

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

Open kajal15003 opened 1 year ago

kajal15003 commented 1 year ago

Please help

yrcong commented 1 year ago

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.

AlphaGoooo commented 1 year ago

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

yrcong commented 1 year ago

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

kajal15003 commented 1 year ago

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

yrcong commented 1 year ago

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

kajal15003 commented 1 year ago

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

CL2LC commented 3 months ago

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

  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’文件在对应位置,解决了就