Centernet: DCNv2 can not built on pytorch1.0

Created on 18 Apr 2019  Â·  9Comments  Â·  Source: xingyizhou/CenterNet

    from ._ext import dcn_v2 as _backend
ModuleNotFoundError: No module named 'models.networks.DCNv2._ext'

the DCNv2 can not be built on pytorch 1.0.

Traceback (most recent call last):
  File "build.py", line 3, in <module>
    from torch.utils.ffi import create_extension
  File "/usr/local/lib/python3.6/dist-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.

Any fix on this?

Most helpful comment

Hi,
Thanks for your interests again. You can check the Pytorch1.0 DCNv2 from the original repo https://github.com/CharlesShang/DCNv2 . Remember also to disable cudnn BN for pytorch 1.0. Our preliminary result on pytorch 1.0 is about 0.4 AP lower than pytorch 0.4.1 (for ctdet_coco_dla_1x). Not sure if this is due to randomness or internal difference between the two versions. Other experiments are not fully tested in pytorch 1.0. You can still test with our pretrained model on pytorch 1.0.

All 9 comments

Hi,
Thanks for your interests again. You can check the Pytorch1.0 DCNv2 from the original repo https://github.com/CharlesShang/DCNv2 . Remember also to disable cudnn BN for pytorch 1.0. Our preliminary result on pytorch 1.0 is about 0.4 AP lower than pytorch 0.4.1 (for ctdet_coco_dla_1x). Not sure if this is due to randomness or internal difference between the two versions. Other experiments are not fully tested in pytorch 1.0. You can still test with our pretrained model on pytorch 1.0.

@xingyizhou I already update DCNv2 to pytorch 1.0 now. It works fine, thanks for your reply.

BTW, how to disable cudnn BN in pytorch?

You can
vim ~/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py
or vim ~/anaconda3/envs/ENV_NAME/lib/python3.6/site-packages/torch/nn/functional.py (if you use
conda environment)
And change torch.backend.cudnn.enabled to False in line 1623.

@xingyizhou I already update DCNv2 to pytorch 1.0 now. It works fine, thanks for your reply.

BTW, how to disable cudnn BN in pytorch?

@jinfagang How would you update DCNv2 to pytorch 1.0

@xingyizhou I already update DCNv2 to pytorch 1.0 now. It works fine, thanks for your reply.
BTW, how to disable cudnn BN in pytorch?

@jinfagang How would you update DCNv2 to pytorch 1.0

Download the new code from the original repo and replace them

@xingyizhou I already update DCNv2 to pytorch 1.0 now. It works fine, thanks for your reply.
BTW, how to disable cudnn BN in pytorch?

@jinfagang How would you update DCNv2 to pytorch 1.0

Download the new code from the original repo and replace them

TKS IT WORKS WELL

I just git clone https://github.com/CharlesShang/DCNv2.git to my repo
and change my pytorch==1.0 for cuda 10
solve the problem
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

@clemente620 Please refer the question #7

Hi,
Thanks for your interests again. You can check the Pytorch1.0 DCNv2 from the original repo https://github.com/CharlesShang/DCNv2 . Remember also to disable cudnn BN for pytorch 1.0. Our preliminary result on pytorch 1.0 is about 0.4 AP lower than pytorch 0.4.1 (for ctdet_coco_dla_1x). Not sure if this is due to randomness or internal difference between the two versions. Other experiments are not fully tested in pytorch 1.0. You can still test with our pretrained model on pytorch 1.0.

Can this method solve his first question?from ._ext import dcn_v2 as _backend ModuleNotFoundError: No module named 'models.networks.DCNv2._ext'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

li980432131 picture li980432131  Â·  6Comments

David-19940718 picture David-19940718  Â·  5Comments

lih627 picture lih627  Â·  7Comments

bhack picture bhack  Â·  6Comments

VRCMF picture VRCMF  Â·  6Comments