mmtracking icon indicating copy to clipboard operation
mmtracking copied to clipboard

cannot import name 'Transformer'

Open hsmwfgie opened this issue 2 years ago • 3 comments

Hello, I have installed the dev-1.x branch so I can use the StrongSort tracker. Unfortunately, however, when I call demo_mot_vis.py, I get an error that Transformer cannot be imported.

What can I do to get StrongSort to work?

Environment sys.platform: linux Python: 3.9.16 (main, Mar 8 2023, 14:00:05) [GCC 11.2.0] CUDA available: True numpy_random_seed: 2147483648 GPU 0,1,2: Tesla V100-SXM2-16GB CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 10.2, V10.2.8 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.10.0+cu111 PyTorch compiling details: PyTorch built with:

  • GCC 7.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.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX512
  • CUDA Runtime 11.1
  • 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.0.5
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -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-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -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 -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.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,

TorchVision: 0.11.0+cu111 OpenCV: 4.7.0 MMEngine: 0.7.0 MMCV: 2.0.0rc4 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 11.1 MMTracking: 1.0.0rc1+0824838

PyTorch is installed by conda

hsmwfgie avatar Mar 17 '23 09:03 hsmwfgie

+1 to this issue, I also ran into this with the following config: mmdet version 3.0.0rc6 mmcv version 2.0.0rc4

It seems like in previous versions of mmdetection the Transformer class lived in mmdetection/mmdet/models/layers/transformer.py, whereas in 3.x transformer is now a folder with more specific transformer classes and the original Transformer class no longer exists. This prevents mmtracking from working with mmdetection 3.x as far as I can tell.

iprivit avatar Mar 17 '23 16:03 iprivit

+1

zylo117 avatar Jun 20 '23 08:06 zylo117

亲测使用3.0.0rc5可以,3.0.0rc6不行

Bethexone avatar May 27 '24 01:05 Bethexone