question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pytorch 1.0 branch ImportError: torch.utils.ffi is deprecated

See original GitHub issue

I followed the instructions for Pytorch 1.0: switched to pytorch-1.0 branch, went to lib and ran python setup.py build develop. Install succeeded with no errors.

However, when I try to import roi_pool in the Python prompt, I get “torch.utils.ffi is deprecated” error. Isn’t this supposed to be fixed in the pytorch-1.0 branch?

Python 3.7.2 (default, Dec 29 2018, 06:19:36) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from model.roi_pooling.modules import roi_pool
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/remoteuser/faster-rcnn.pytorch/lib/model/roi_pooling/modules/roi_pool.py", line 2, in <module>
    from ..functions.roi_pool import RoIPoolFunction
  File "/home/remoteuser/faster-rcnn.pytorch/lib/model/roi_pooling/functions/roi_pool.py", line 3, in <module>
    from .._ext import roi_pooling
  File "/home/remoteuser/faster-rcnn.pytorch/lib/model/roi_pooling/_ext/roi_pooling/__init__.py", line 2, in <module>
    from torch.utils.ffi import _wrap_function
  File "/home/remoteuser/.miniconda3/envs/outfit/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
    raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:22

github_iconTop GitHub Comments

33reactions
ljtruongcommented, Jan 22, 2019

@lzxzy confirmed it works. using git checkout pytorch-1.0 will fix your problem.

14reactions
adityaarun1commented, Jan 6, 2019

Yes, it does work for me. Infact, I have successfully trained my model with the new branch. Ensure that you are on the correct branch with git branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

torch.utils.ffi is deprecated. Please use cpp extensions instead
ImportError : torch. utils. ffi is deprecated. Please use cpp extensions instead - PyTorch Forums.
Read more >
How can I solve "torch.utils.ffi is deprecated. Please use cpp ...
ImportError : torch.utils.ffi is deprecated. Please use cpp extensions instead. I have been searching solution on the online. The problem is the ...
Read more >
torch.utils.ffi is deprecated. Please use cpp extensions instead ...
ImportError : torch.utils.ffi is deprecated. Please use cpp extensions instead. 2022-09-02 05:23:14.
Read more >
Faster-RCNN.pytorch的搭建、使用过程详解(适配PyTorch 1.0 ...
git clone -b pytorch-1.0 --single-branch --depth=1 --recursive ... 环境后,运行训练时出现错误 ImportError: torch.utils.ffi is deprecated.
Read more >
CenterNet - Bountysource
... torch.utils.ffi is deprecated. Please use cpp extensions instead". I've also searched the solution but it needs to install pytorch<=1.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found