Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with torch.utils.ffi #30

Closed
RRuschel opened this issue Apr 29, 2022 · 2 comments
Closed

Problem with torch.utils.ffi #30

RRuschel opened this issue Apr 29, 2022 · 2 comments

Comments

@RRuschel
Copy link

RRuschel commented Apr 29, 2022

Hello,

I am trying to run your code but I'm coming across some issues regarding torch.utils.ffi.
I compiled the draw_rectangles, fpn. Then compiled faster rcnn as instructed and copied the files over the fasterRCNN folder inside STTran, but when I try to run the code as it tries to resolve all the dependencies from line 10 on test.py from lib.object_detector import detector it crashes with the following error:

File "/media/hdd5/raphael/HOI/STTran/test.py", line 10, in
from lib.object_detector import detector
File "/media/hdd5/raphael/HOI/STTran/lib/object_detector.py", line 10, in
from fasterRCNN.lib.model.faster_rcnn.resnet import resnet
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/faster_rcnn/resnet.py", line 6, in
from fasterRCNN.lib.model.faster_rcnn.faster_rcnn import _fasterRCNN
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/faster_rcnn/faster_rcnn.py", line 10, in
from model.rpn.rpn import _RPN
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/rpn/rpn.py", line 8, in
from .proposal_layer import _ProposalLayer
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/rpn/proposal_layer.py", line 20, in
from model.nms.nms_wrapper import nms
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/nms/nms_wrapper.py", line 10, in
from model.nms.nms_gpu import nms_gpu
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/nms/nms_gpu.py", line 4, in
from ._ext import nms
File "/media/hdd5/raphael/HOI/STTran/fasterRCNN/lib/model/nms/_ext/nms/init.py", line 2, in
from torch.utils.ffi import _wrap_function
File "/media/hdd5/raphael/HOI/HOI_env/lib/python3.8/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

This seems to be deprecated for pytorch versions > 0.4 but on the repo, it is stated to use 1.1. Strangely I tried downgrading to torch==0.4.1 but the same error persists.
Any ideas on how to work around that would be appreciated!

@yrcong
Copy link
Owner

yrcong commented Apr 29, 2022

Could you please tell me which GPU and CUDA version you are using?

@RRuschel
Copy link
Author

RRuschel commented May 2, 2022

I am using a couple of Titans Xp.
But I fixed it, I was mistakenly compiling the faster RCNN code for older PyTorch instead of the newer branch that is for pytorch 1.

@RRuschel RRuschel closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants