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

ImportError: Cannot import 'detrex._C', therefore 'MultiScaleDeformableAttention' is not available #85

Closed
ray-lee-94 opened this issue Sep 29, 2022 · 4 comments

Comments

@ray-lee-94
Copy link

I install the detrex==0.1.0 success. But when running the train_net, I get the error.

error info

WARNING:root:Pytorch pre-release version 1.13.0.dev20220914+cu113 - assuming intent to test it
projects/dino/configs/dino_r50_4scale_12ep.py
[09/29 14:20:44 detectron2]: Rank of current process: 0. World size: 1
cuobjdump info    : File '/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torchvision/_C.so' does not contain device code
[09/29 14:20:46 detectron2]: Environment info:
----------------------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sys.platform            linux
Python                  3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0]
numpy                   1.23.3
detectron2              0.6 @/data/lr/detrex/detectron2/detectron2
detectron2._C           not built correctly: /data/lr/detrex/detectron2/detectron2/_C.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefIlEENS2_8optionalINS2_10ScalarTypeEEENS5_INS2_6LayoutEEENS5_INS2_6DeviceEEENS5_IbEENS5_INS2_12MemoryFormatEEE
Compiler ($CXX)         c++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
CUDA compiler           Build cuda_11.6.r11.6/compiler.31057947_0
detectron2 arch flags   7.0
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.13.0.dev20220914+cu113 @/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torch
PyTorch debug build     False
GPU available           Yes
GPU 0,1,2,3             NVIDIA A40 (arch=8.6)
Driver version          515.65.01
CUDA_HOME               /usr/local/cuda
Pillow                  9.2.0
torchvision             0.14.0.dev20220928 @/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torchvision
torchvision arch flags  /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torchvision/_C.so
fvcore                  0.1.5.post20220512
iopath                  0.1.9
cv2                     4.5.5
----------------------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PyTorch built with:
  - GCC 9.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
  - CuDNN 8.4.1  (built against CUDA 11.6)
    - Built with CuDNN 8.3.2
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.13.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, 

[09/29 14:20:46 detectron2]: Command line arguments: Namespace(config_file='projects/dino/configs/dino_r50_4scale_12ep.py', resume=False, eval_only=False, num_gpus=1, num_machines=1, machine_rank=0, dist_url='tcp://127.0.0.1:50156', opts=[])
[09/29 14:20:46 detectron2]: Contents of args.config_file=projects/dino/configs/dino_r50_4scale_12ep.py:
from detrex.config import get_config
from .models.dino_r50 import model

# get default config
dataloader = get_config("common/data/coco_detr.py").dataloader
optimizer = get_config("common/optim.py").AdamW
lr_multiplier = get_config("common/coco_schedule.py").lr_multiplier_12ep
train = get_config("common/train.py").train

# modify training config
train.init_checkpoint = "detectron2://ImageNetPretrained/torchvision/R-50.pkl"
train.output_dir = "./output/dino_r50_4scale_12ep"
train.max_iter = 90000
train.clip_grad.enabled = True
train.clip_grad.params.max_norm = 0.1
train.clip_grad.params.norm_type = 2
train.seed = 42

# modify optimizer config
optimizer.weight_decay = 1e-4
optimizer.params.lr_factor_func = lambda module_name: 0.1 if "backbone" in module_name else 1

# modify dataloader config
dataloader.train.dataset.filter_empty = False
dataloader.train.num_workers = 16

WARNING [09/29 14:20:46 d2.config.lazy]: The config contains objects that cannot serialize to a valid yaml. ./output/dino_r50_4scale_12ep/config.yaml is human-readable but cannot be loaded.
WARNING [09/29 14:20:46 d2.config.lazy]: Config is saved using cloudpickle at ./output/dino_r50_4scale_12ep/config.yaml.pkl.
[09/29 14:20:46 detectron2]: Full config saved to ./output/dino_r50_4scale_12ep/config.yaml
Traceback (most recent call last):
  File "/data/lr/detrex/tools/train_net.py", line 231, in <module>
    launch(
  File "/data/lr/detrex/detectron2/detectron2/engine/launch.py", line 82, in launch
    main_func(*args)
  File "/data/lr/detrex/tools/train_net.py", line 225, in main
    do_train(args, cfg)
  File "/data/lr/detrex/tools/train_net.py", line 159, in do_train
    model = instantiate(cfg.model)
  File "/data/lr/detrex/detectron2/detectron2/config/instantiate.py", line 67, in instantiate
    cfg = {k: instantiate(v) for k, v in cfg.items()}
  File "/data/lr/detrex/detectron2/detectron2/config/instantiate.py", line 67, in <dictcomp>
    cfg = {k: instantiate(v) for k, v in cfg.items()}
  File "/data/lr/detrex/detectron2/detectron2/config/instantiate.py", line 67, in instantiate
    cfg = {k: instantiate(v) for k, v in cfg.items()}
  File "/data/lr/detrex/detectron2/detectron2/config/instantiate.py", line 67, in <dictcomp>
    cfg = {k: instantiate(v) for k, v in cfg.items()}
  File "/data/lr/detrex/detectron2/detectron2/config/instantiate.py", line 83, in instantiate
    return cls(**cfg)
  File "/data/lr/detrex/projects/dino/modeling/dino_transformer.py", line 45, in __init__
    attn=MultiScaleDeformableAttention(
  File "/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/detrex-0.1.0-py3.10-linux-x86_64.egg/detrex/layers/multi_scale_deform_attn.py", line 373, in __init__
    raise ImportError(err)
ImportError: Cannot import 'detrex._C', therefore 'MultiScaleDeformableAttention' is not available. detrex is not compiled successfully, please build following the instructions!

Install log

Building wheel detrex-0.1.0
running install
/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
writing detrex.egg-info/PKG-INFO
writing dependency_links to detrex.egg-info/dependency_links.txt
writing requirements to detrex.egg-info/requires.txt
writing top-level names to detrex.egg-info/top_level.txt
/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torch/utils/cpp_extension.py:472: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'detrex.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'detrex.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying detrex/version.py -> build/lib.linux-x86_64-cpython-310/detrex
running build_ext
/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/torch/utils/cpp_extension.py:383: UserWarning: The detected CUDA version (11.6) has a minor version mismatch with the version that was used to compile PyTorch (11.3). Most likely this shouldn't be a problem.
  warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/detrex
creating build/bdist.linux-x86_64/egg/detrex/utils
copying build/lib.linux-x86_64-cpython-310/detrex/utils/dist.py -> build/bdist.linux-x86_64/egg/detrex/utils
copying build/lib.linux-x86_64-cpython-310/detrex/utils/misc.py -> build/bdist.linux-x86_64/egg/detrex/utils
copying build/lib.linux-x86_64-cpython-310/detrex/utils/__init__.py -> build/bdist.linux-x86_64/egg/detrex/utils
copying build/lib.linux-x86_64-cpython-310/detrex/version.py -> build/bdist.linux-x86_64/egg/detrex
creating build/bdist.linux-x86_64/egg/detrex/modeling
creating build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/dice_loss.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/smooth_l1_loss.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/focal_loss.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/giou_loss.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/utils.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/losses/cross_entropy_loss.py -> build/bdist.linux-x86_64/egg/detrex/modeling/losses
creating build/bdist.linux-x86_64/egg/detrex/modeling/criterion
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/criterion/criterion.py -> build/bdist.linux-x86_64/egg/detrex/modeling/criterion
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/criterion/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling/criterion
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/criterion/base_criterion.py -> build/bdist.linux-x86_64/egg/detrex/modeling/criterion
creating build/bdist.linux-x86_64/egg/detrex/modeling/matcher
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/matcher/match_cost.py -> build/bdist.linux-x86_64/egg/detrex/modeling/matcher
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/matcher/matcher.py -> build/bdist.linux-x86_64/egg/detrex/modeling/matcher
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/matcher/modified_matcher.py -> build/bdist.linux-x86_64/egg/detrex/modeling/matcher
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/matcher/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling/matcher
creating build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/timm_backbone.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/convnext.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/resnet.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/focalnet.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/backbone/torchvision_backbone.py -> build/bdist.linux-x86_64/egg/detrex/modeling/backbone
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling
creating build/bdist.linux-x86_64/egg/detrex/modeling/neck
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/neck/__init__.py -> build/bdist.linux-x86_64/egg/detrex/modeling/neck
copying build/lib.linux-x86_64-cpython-310/detrex/modeling/neck/channel_mapper.py -> build/bdist.linux-x86_64/egg/detrex/modeling/neck
copying build/lib.linux-x86_64-cpython-310/detrex/_C.cpython-310-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/detrex
creating build/bdist.linux-x86_64/egg/detrex/config
creating build/bdist.linux-x86_64/egg/detrex/config/configs
creating build/bdist.linux-x86_64/egg/detrex/config/configs/common
copying build/lib.linux-x86_64-cpython-310/detrex/config/configs/common/coco_schedule.py -> build/bdist.linux-x86_64/egg/detrex/config/configs/common
copying build/lib.linux-x86_64-cpython-310/detrex/config/configs/common/train.py -> build/bdist.linux-x86_64/egg/detrex/config/configs/common
creating build/bdist.linux-x86_64/egg/detrex/config/configs/common/data
copying build/lib.linux-x86_64-cpython-310/detrex/config/configs/common/data/coco_detr.py -> build/bdist.linux-x86_64/egg/detrex/config/configs/common/data
copying build/lib.linux-x86_64-cpython-310/detrex/config/configs/common/data/coco.py -> build/bdist.linux-x86_64/egg/detrex/config/configs/common/data
copying build/lib.linux-x86_64-cpython-310/detrex/config/configs/common/optim.py -> build/bdist.linux-x86_64/egg/detrex/config/configs/common
copying build/lib.linux-x86_64-cpython-310/detrex/config/__init__.py -> build/bdist.linux-x86_64/egg/detrex/config
copying build/lib.linux-x86_64-cpython-310/detrex/config/config.py -> build/bdist.linux-x86_64/egg/detrex/config
copying build/lib.linux-x86_64-cpython-310/detrex/__init__.py -> build/bdist.linux-x86_64/egg/detrex
creating build/bdist.linux-x86_64/egg/detrex/data
copying build/lib.linux-x86_64-cpython-310/detrex/data/detr_dataset_mapper.py -> build/bdist.linux-x86_64/egg/detrex/data
copying build/lib.linux-x86_64-cpython-310/detrex/data/__init__.py -> build/bdist.linux-x86_64/egg/detrex/data
creating build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/shape_spec.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/position_embedding.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/layer_norm.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/transformer.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/conv.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/box_ops.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/mlp.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/denoising.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/attention.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/multi_scale_deform_attn.py -> build/bdist.linux-x86_64/egg/detrex/layers
copying build/lib.linux-x86_64-cpython-310/detrex/layers/__init__.py -> build/bdist.linux-x86_64/egg/detrex/layers
byte-compiling build/bdist.linux-x86_64/egg/detrex/utils/dist.py to dist.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/utils/misc.py to misc.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/utils/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/version.py to version.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/dice_loss.py to dice_loss.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/smooth_l1_loss.py to smooth_l1_loss.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/focal_loss.py to focal_loss.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/giou_loss.py to giou_loss.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/utils.py to utils.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/losses/cross_entropy_loss.py to cross_entropy_loss.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/criterion/criterion.py to criterion.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/criterion/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/criterion/base_criterion.py to base_criterion.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/matcher/match_cost.py to match_cost.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/matcher/matcher.py to matcher.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/matcher/modified_matcher.py to modified_matcher.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/matcher/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/timm_backbone.py to timm_backbone.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/convnext.py to convnext.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/resnet.py to resnet.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/focalnet.py to focalnet.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/backbone/torchvision_backbone.py to torchvision_backbone.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/neck/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/modeling/neck/channel_mapper.py to channel_mapper.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/configs/common/coco_schedule.py to coco_schedule.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/configs/common/train.py to train.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/configs/common/data/coco_detr.py to coco_detr.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/configs/common/data/coco.py to coco.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/configs/common/optim.py to optim.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/config/config.py to config.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/data/detr_dataset_mapper.py to detr_dataset_mapper.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/data/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/shape_spec.py to shape_spec.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/position_embedding.py to position_embedding.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/layer_norm.py to layer_norm.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/transformer.py to transformer.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/conv.py to conv.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/box_ops.py to box_ops.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/mlp.py to mlp.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/denoising.py to denoising.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/attention.py to attention.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/multi_scale_deform_attn.py to multi_scale_deform_attn.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/egg/detrex/layers/__init__.py to __init__.cpython-310.pyc
creating stub loader for detrex/_C.cpython-310-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/detrex/_C.py to _C.cpython-310.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying detrex.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying detrex.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying detrex.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying detrex.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying detrex.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
detrex.__pycache__._C.cpython-310: module references __file__
creating 'dist/detrex-0.1.0-py3.10-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing detrex-0.1.0-py3.10-linux-x86_64.egg
removing '/data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/detrex-0.1.0-py3.10-linux-x86_64.egg' (and everything under it)
creating /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/detrex-0.1.0-py3.10-linux-x86_64.egg
Extracting detrex-0.1.0-py3.10-linux-x86_64.egg to /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
detrex 0.1.0 is already the active version in easy-install.pth

Installed /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/detrex-0.1.0-py3.10-linux-x86_64.egg
Processing dependencies for detrex==0.1.0
Searching for psutil==5.9.2
Best match: psutil 5.9.2
Processing psutil-5.9.2-py3.10-linux-x86_64.egg
psutil 5.9.2 is already the active version in easy-install.pth

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages/psutil-5.9.2-py3.10-linux-x86_64.egg
Searching for scipy==1.9.1
Best match: scipy 1.9.1
Adding scipy 1.9.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pytest==7.1.3
Best match: pytest 7.1.3
Adding pytest 7.1.3 to easy-install.pth file
Installing py.test script to /data/lr/anaconda3/envs/detrex/bin
Installing pytest script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for timm==0.6.7
Best match: timm 0.6.7
Adding timm 0.6.7 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for autoflake==1.6.1
Best match: autoflake 1.6.1
Adding autoflake 1.6.1 to easy-install.pth file
Installing autoflake script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for black==22.3.0
Best match: black 22.3.0
Adding black 22.3.0 to easy-install.pth file
Installing black script to /data/lr/anaconda3/envs/detrex/bin
Installing blackd script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for isort==4.3.21
Best match: isort 4.3.21
Adding isort 4.3.21 to easy-install.pth file
Installing isort script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for flake8==3.8.1
Best match: flake8 3.8.1
Adding flake8 3.8.1 to easy-install.pth file
Installing flake8 script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pybind11==2.10.0
Best match: pybind11 2.10.0
Adding pybind11 2.10.0 to easy-install.pth file
Installing pybind11-config script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for omegaconf==2.1.0
Best match: omegaconf 2.1.0
Adding omegaconf 2.1.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for hydra-core==1.1.2
Best match: hydra-core 1.1.2
Adding hydra-core 1.1.2 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for cloudpickle==2.2.0
Best match: cloudpickle 2.2.0
Adding cloudpickle 2.2.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for numpy==1.23.3
Best match: numpy 1.23.3
Adding numpy 1.23.3 to easy-install.pth file
Installing f2py script to /data/lr/anaconda3/envs/detrex/bin
Installing f2py3 script to /data/lr/anaconda3/envs/detrex/bin
Installing f2py3.10 script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for tomli==2.0.1
Best match: tomli 2.0.1
Adding tomli 2.0.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for py==1.11.0
Best match: py 1.11.0
Adding py 1.11.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pluggy==1.0.0
Best match: pluggy 1.0.0
Adding pluggy 1.0.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for packaging==21.3
Best match: packaging 21.3
Adding packaging 21.3 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for iniconfig==1.1.1
Best match: iniconfig 1.1.1
Adding iniconfig 1.1.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for attrs==22.1.0
Best match: attrs 22.1.0
Adding attrs 22.1.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for torchvision==0.14.0.dev20220928
Best match: torchvision 0.14.0.dev20220928
Adding torchvision 0.14.0.dev20220928 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for torch==1.13.0.dev20220914+cu113
Best match: torch 1.13.0.dev20220914+cu113
Adding torch 1.13.0.dev20220914+cu113 to easy-install.pth file
Installing convert-caffe2-to-onnx script to /data/lr/anaconda3/envs/detrex/bin
Installing convert-onnx-to-caffe2 script to /data/lr/anaconda3/envs/detrex/bin
Installing torchrun script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pyflakes==2.2.0
Best match: pyflakes 2.2.0
Adding pyflakes 2.2.0 to easy-install.pth file
Installing pyflakes script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for mypy-extensions==0.4.3
Best match: mypy-extensions 0.4.3
Adding mypy-extensions 0.4.3 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pathspec==0.10.1
Best match: pathspec 0.10.1
Adding pathspec 0.10.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for platformdirs==2.5.2
Best match: platformdirs 2.5.2
Adding platformdirs 2.5.2 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for click==8.1.3
Best match: click 8.1.3
Adding click 8.1.3 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for mccabe==0.6.1
Best match: mccabe 0.6.1
Adding mccabe 0.6.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pycodestyle==2.6.0
Best match: pycodestyle 2.6.0
Adding pycodestyle 2.6.0 to easy-install.pth file
Installing pycodestyle script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for PyYAML==6.0
Best match: PyYAML 6.0
Adding PyYAML 6.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for antlr4-python3-runtime==4.8
Best match: antlr4-python3-runtime 4.8
Adding antlr4-python3-runtime 4.8 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for pyparsing==3.0.9
Best match: pyparsing 3.0.9
Adding pyparsing 3.0.9 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for Pillow==9.2.0
Best match: Pillow 9.2.0
Adding Pillow 9.2.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for requests==2.28.1
Best match: requests 2.28.1
Adding requests 2.28.1 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for typing-extensions==4.3.0
Best match: typing-extensions 4.3.0
Adding typing-extensions 4.3.0 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for certifi==2022.9.14
Best match: certifi 2022.9.14
Adding certifi 2022.9.14 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for urllib3==1.26.12
Best match: urllib3 1.26.12
Adding urllib3 1.26.12 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for idna==3.4
Best match: idna 3.4
Adding idna 3.4 to easy-install.pth file

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Searching for charset-normalizer==2.1.1
Best match: charset-normalizer 2.1.1
Adding charset-normalizer 2.1.1 to easy-install.pth file
Installing normalizer script to /data/lr/anaconda3/envs/detrex/bin

Using /data/lr/anaconda3/envs/detrex/lib/python3.10/site-packages
Finished processing dependencies for detrex==0.1.0
@ray-lee-94
Copy link
Author

I install ninja by

sudo apt install ninja-build

and rebuild detectron2 by

python setup.py build 
python setup.py install

and rebuild detrex

python setup.py build 
python setup.py install

After that, the error is gone!

@rentainhe
Copy link
Collaborator

rentainhe commented Sep 29, 2022

I install ninja by

sudo apt install ninja-build

and rebuild detectron2 by

python setup.py build 
python setup.py install

and rebuild detrex

python setup.py build 
python setup.py install

After that, the error is gone!

Yes, ninja is optional I guess but you should make sure that CUDA_HOME is not None. Maybe you can check it by running:

from torch.utils.cpp_extension import CUDA_HOME

print(CUDA_HOME)

if CUDA_HOME is None, please set it as:

export CUDA_HOME=/path/to/cuda11.3/

just an example

@ray-lee-94
Copy link
Author

@rentainhe Thank you for your replay.

Python 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from torch.utils.cpp_extension import CUDA_HOME
>>> print(CUDA_HOME)
/usr/local/cuda
>>> 

Maybe I haven't set the variable when I build it for the first time.
I did set the variable CUDA_HOME manually in .bashrc

export CUDA_HOME=/usr/local/cuda

And then rebuild again.

Thank you again! Now I can train on COCO correctly!

@rentainhe
Copy link
Collaborator

rentainhe commented Sep 30, 2022

@rentainhe Thank you for your replay.

Python 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from torch.utils.cpp_extension import CUDA_HOME
>>> print(CUDA_HOME)
/usr/local/cuda
>>> 

Maybe I haven't set the variable when I build it for the first time. I did set the variable CUDA_HOME manually in .bashrc

export CUDA_HOME=/usr/local/cuda

And then rebuild again.

Thank you again! Now I can train on COCO correctly!

You're welcome~, leave an issue any time if you need our help : )

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