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

TypeError: init() missing 1 required positional argument: 'coord_type' in FCOS3D Model #3040

Open
3 tasks done
Hafizirshaid opened this issue Sep 17, 2024 · 1 comment
Open
3 tasks done

Comments

@Hafizirshaid
Copy link

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

1.x branch https://github.com/open-mmlab/mmdetection3d/tree/dev-1.x

Environment

/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/optim/optimizer/zero_optimizer.py:11: DeprecationWarning: TorchScript support for functional optimizers is deprecated and will be removed in a future PyTorch release. Consider using the torch.compile optimizer instead.
from torch.distributed.optim import
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:47: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead.
_TORCH_CUSTOM_FWD = amp.custom_fwd(cast_inputs=torch.float16)
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:97: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:163: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:243: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:332: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:369: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:389: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/spconv/pytorch/functional.py:412: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
def backward(ctx, grad_output):
sys.platform: linux
Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 4090
CUDA_HOME: /usr
NVCC: Cuda compilation tools, release 12.4, V12.4.131
GCC: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
PyTorch: 2.4.1
PyTorch compiling details: PyTorch built with:

  • GCC 9.3
  • C++ Version: 201703
  • Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v3.4.2 (Git Hash 1137e04ec0b5251ca2b4400a4fd3c667ce843d67)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX512
  • CUDA Runtime 12.4
  • NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-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;-gencode;arch=compute_90,code=sm_90
  • CuDNN 90.1
  • Magma 2.6.1
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=12.4, CUDNN_VERSION=9.1.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -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-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -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=2.4.1, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=1, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF,

TorchVision: 0.19.1
OpenCV: 4.10.0
MMEngine: 0.10.3
MMDetection: 3.3.0
MMDetection3D: 1.4.0+962f093
spconv2.0: True

Reproduces the problem - code sample

from mmdet3d.apis import init_model, inference_detector
import mmcv


def main():
    config_file = 'configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d_finetune.py'
    checkpoint_file = 'checkpoints/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d_finetune_20210717_095645-8d806dc2.pth'

    # Init Model using Config and Checkpoint files
    model = init_model(config_file, checkpoint_file, device='cpu')

    # Local Image Oatg
    img = 'demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_FRONT__1532402927612460.jpg'
    image = mmcv.imread(img)

    # Run inference
    result, data = inference_detector(model, image)



if __name__ == '__main__':
    main()

Reproduces the problem - command or script

the prevuois code is stored in a new file called inference.py and triggered using the command line.
python inference.py

Reproduces the problem - error message

Traceback (most recent call last):
File "inference.py", line 22, in
main()
File "inference.py", line 17, in main
result, data = inference_detector(model, image)
File "/home/irshaidh/mmdetection3d/mmdet3d/apis/inference.py", line 150, in inference_detector
test_pipeline = Compose(test_pipeline)
File "/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 38, in init
transform = TRANSFORMS.build(transform)
File "/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "/home/irshaidh/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
obj = obj_cls(**args) # type: ignore
TypeError: init() missing 1 required positional argument: 'coord_type'

Additional information

I am using inference_detector and passing FCOS3D model with its config.
What I'm trying to do here is to run this model and feed an image to it so I can do 3D object detection on new images. Right now, I keep getting this error TypeError: __init__() missing 1 required positional argument: 'coord_type'
Is there any solution for this issue?

Thanks,

@Hafizirshaid Hafizirshaid changed the title [Bug] TypeError: init() missing 1 required positional argument: 'coord_type' Sep 17, 2024
@Hafizirshaid Hafizirshaid changed the title TypeError: init() missing 1 required positional argument: 'coord_type' TypeError: init() missing 1 required positional argument: 'coord_type' in FCOS3D Model Sep 17, 2024
@justicme
Copy link

hello , I encountered this issue while deploying FCOS3D as well. Do you have any good solutions?

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