grimoire/mmdetection-to-tensorrt

Size Mismatch

selimceylan opened this issue · 2 comments

Describe the bug
Hi,
I am trying to convert a two stage model and I have two warning:

size mismatch for rpn_head.rpn_reg.weight: copying a param with shape torch.Size([18, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([12, 256, 1, 1]).
size mismatch for rpn_head.rpn_reg.bias: copying a param with shape torch.Size([18]) from checkpoint, the shape in current model is torch.Size([12]).

environment:
Please provide your environment by:

python tools/collect_env.py

Collecting environment information...
PyTorch version: 1.10.1
Is debug build: False
CUDA used to build PyTorch: 11.3
OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.17
Python version: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-91-generic-x86_64-with-debian-buster-sid
Is CUDA available: True
CUDA runtime version: 11.3.109
GPU models and configuration:
GPU 0: NVIDIA TITAN RTX

Nvidia driver version: 465.19.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.0
Versions of relevant libraries:
[pip3] mmcv-full==1.3.9
[pip3] mmdet==2.11.0
[pip3] mmdet2trt==0.5.0
[pip3] tensorrt==8.2.2.1
[pip3] torch==1.10.1
[pip3] torch2trt-dynamic==0.5.0
[pip3] torchaudio==0.10.1
[pip3] torchvision==0.11.2
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] mmcv-full 1.3.9 pypi_0 pypi
[conda] mmdet 2.11.0 pypi_0 pypi
[conda] mmdet2trt 0.5.0 dev_0
[conda] pytorch 1.10.1 py3.7_cuda11.3_cudnn8.2.0_0 pytorch
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] tensorrt 8.2.2.1 pypi_0 pypi
[conda] torch2trt-dynamic 0.5.0 dev_0
[conda] torchaudio 0.10.1 py37_cu113 pytorch
[conda] torchvision 0.11.2 py37_cu113 pytorch

Additional context
Do I have to do something for get rid of this warning? If yes, Please direct me.

Hi,
Could you please provide more detail about the model config?

Sorry for misunderstanding, I solved my issue with changing the values to the original.