zylo117 / Yet-Another-EfficientDet-Pytorch

The pytorch re-implement of the official efficientdet with SOTA performance in real time and pretrained weights.
GNU Lesser General Public License v3.0
5.2k stars 1.27k forks source link

testing inference on google colab, giving RuntimeError: Error(s) in loading state_dict for EfficientDetBackbone: #719

Closed santhoshnumberone closed 2 years ago

santhoshnumberone commented 2 years ago

I ran these blocks back to back on google colab

from google.colab import drive
drive.mount('/content/drive/')
%%shell
pip install pycocotools numpy opencv-python tqdm tensorboard tensorboardX pyyaml webcolors
pip install torch==1.4.0
pip install torchvision==0.5.0
import os
os.chdir("/content/drive/MyDrive/EDNet/")
!git clone https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch.git
import os
os.chdir("/content/drive/MyDrive/EDNet/Yet-Another-EfficientDet-Pytorch/")

import time
import torch
from torch.backends import cudnn
from matplotlib import colors

from backbone import EfficientDetBackbone
import cv2
import numpy as np

from efficientdet.utils import BBoxTransform, ClipBoxes
from utils.utils import preprocess, invert_affine, postprocess, STANDARD_COLORS, standard_to_bgr, get_index_label, plot_one_box
compound_coef = 0
force_input_size = None  # set None to use default size
img_path = '/content/drive/MyDrive/dataset/images/fr-60.jpg'

# replace this part with your project's anchor config
anchor_ratios = [(1.0, 1.0), (1.4, 0.7), (0.7, 1.4)]
anchor_scales = [2 ** 0, 2 ** (1.0 / 3.0), 2 ** (2.0 / 3.0)]

threshold = 0.2
iou_threshold = 0.2

use_cuda = False
use_float16 = False
cudnn.fastest = True
cudnn.benchmark = True

obj_list = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
            'fire hydrant', '', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
            'cow', 'elephant', 'bear', 'zebra', 'giraffe', '', 'backpack', 'umbrella', '', '', 'handbag', 'tie',
            'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove',
            'skateboard', 'surfboard', 'tennis racket', 'bottle', '', 'wine glass', 'cup', 'fork', 'knife', 'spoon',
            'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut',
            'cake', 'chair', 'couch', 'potted plant', 'bed', '', 'dining table', '', '', 'toilet', '', 'tv',
            'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
            'refrigerator', '', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier',
            'toothbrush']

color_list = standard_to_bgr(STANDARD_COLORS)
# tf bilinear interpolation is different from any other's, just make do
input_sizes = [512, 640, 768, 896, 1024, 1280, 1280, 1536, 1536]
input_size = input_sizes[compound_coef] if force_input_size is None else force_input_size
ori_imgs, framed_imgs, framed_metas = preprocess(img_path, max_size=input_size)
if use_cuda:
    x = torch.stack([torch.from_numpy(fi).cuda() for fi in framed_imgs], 0)
else:
    x = torch.stack([torch.from_numpy(fi) for fi in framed_imgs], 0)

x = x.to(torch.float32 if not use_float16 else torch.float16).permute(0, 3, 1, 2)
model = EfficientDetBackbone(compound_coef=compound_coef, num_classes=len(obj_list),
                             ratios=anchor_ratios, scales=anchor_scales)
model.load_state_dict(torch.load(f'/content/drive/MyDrive/EDNet/Yet-Another-EfficientDet-Pytorch/weights/efficientdet-d3.pth'))
model.requires_grad_(False)
model.eval()

I get this error while trying to load efficientdet-d3.pth

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-19-e1f1e3313867>](https://localhost:8080/#) in <module>()
      1 model = EfficientDetBackbone(compound_coef=compound_coef, num_classes=len(obj_list),
      2                              ratios=anchor_ratios, scales=anchor_scales)
----> 3 model.load_state_dict(torch.load('/content/drive/MyDrive/EDNet/Yet-Another-EfficientDet-Pytorch/weights/efficientdet-d3.pth'))
      4 model.requires_grad_(False)
      5 model.eval()

[/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in load_state_dict(self, state_dict, strict)
    828         if len(error_msgs) > 0:
    829             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 830                                self.__class__.__name__, "\n\t".join(error_msgs)))
    831         return _IncompatibleKeys(missing_keys, unexpected_keys)
    832 

RuntimeError: Error(s) in loading state_dict for EfficientDetBackbone:
    Missing key(s) in state_dict: "backbone_net.model._blocks.1._expand_conv.conv.weight", "backbone_net.model._blocks.1._bn0.weight", "backbone_net.model._blocks.1._bn0.bias", "backbone_net.model._blocks.1._bn0.running_mean", "backbone_net.model._blocks.1._bn0.running_var". 
    Unexpected key(s) in state_dict: "bifpn.3.p6_w1", "bifpn.3.p5_w1", "bifpn.3.p4_w1", "bifpn.3.p3_w1", "bifpn.3.p4_w2", "bifpn.3.p5_w2", "bifpn.3.p6_w2", "bifpn.3.p7_w2", "bifpn.3.conv6_up.depthwise_conv.conv.weight", "bifpn.3.conv6_up.pointwise_conv.conv.weight", "bifpn.3.conv6_up.pointwise_conv.conv.bias", "bifpn.3.conv6_up.bn.weight", "bifpn.3.conv6_up.bn.bias", "bifpn.3.conv6_up.bn.running_mean", "bifpn.3.conv6_up.bn.running_var", "bifpn.3.conv6_up.bn.num_batches_tracked", "bifpn.3.conv5_up.depthwise_conv.conv.weight", "bifpn.3.conv5_up.pointwise_conv.conv.weight", "bifpn.3.conv5_up.pointwise_conv.conv.bias", "bifpn.3.conv5_up.bn.weight", "bifpn.3.conv5_up.bn.bias", "bifpn.3.conv5_up.bn.running_mean", "bifpn.3.conv5_up.bn.running_var", "bifpn.3.conv5_up.bn.num_batches_tracked", "bifpn.3.conv4_up.depthwise_conv.conv.weight", "bifpn.3.conv4_up.pointwise_conv.conv.weight", "bifpn.3.conv4_up.pointwise_conv.conv.bias", "bifpn.3.conv4_up.bn.weight", "bifpn.3.conv4_up.bn.bias", "bifpn.3.conv4_up.bn.running_mean", "bifpn.3.conv4_up.bn.running_var", "bifpn.3.conv4_up.bn.num_batches_tracked", "bifpn.3.conv3_up.depthwise_conv.conv.weight", "bifpn.3.conv3_up.pointwise_conv.conv.weight", "bifpn.3.conv3_up.pointwise_conv.conv.bias", "bifpn.3.conv3_up.bn.weight", "bifpn.3.conv3_up.bn.bias", "bifpn.3.conv3_up.bn.running_mean", "bifpn.3.conv3_up.bn.running_var", "bifpn.3.conv3_up.bn.num_batches_tracked", "bifpn.3.conv4_down.depthwise_conv.conv.weight", "bifpn.3.conv4_down.pointwise_conv...
    size mismatch for bifpn.0.conv6_up.depthwise_conv.conv.weight: copying a param with shape torch.Size([160, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]).
    size mismatch for bifpn.0.conv6_up.pointwise_conv.conv.weight: copying a param with shape torch.Size([160, 160, 1, 1]) from checkpoint, the shape in current model is torch.Size([64, 64, 1, 1]).
    size mismatch for bifpn.0.conv6_up.pointwise_conv.conv.bias: copying a param with shape torch.Size([160]) from checkpoint, the shape in current model is torch.Size([64]).
    size mismatch for bifpn.0.conv6_up.bn.weight: copying a param with shape torch.Size([160]) from checkpoint, the shape in current model is torch.Size([64]).
    size mismatch for bifpn.0.conv6_up.bn.bias: copying a param with shape torch.Size([160]) from checkpoint, the shape in current model is torch.Size([64]).
......
......
......
size mismatch for backbone_net.model._blocks.11._bn0.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._bn0.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._depthwise_conv.conv.weight: copying a param with shape torch.Size([576, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([672, 1, 5, 5]).
    size mismatch for backbone_net.model._blocks.11._bn1.weight: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._bn1.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._bn1.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._bn1.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._se_reduce.conv.weight: copying a param with shape torch.Size([24, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([28, 672, 1, 1]).
    size mismatch for backbone_net.model._blocks.11._se_reduce.conv.bias: copying a param with shape torch.Size([24]) from checkpoint, the shape in current model is torch.Size([28]).
    size mismatch for backbone_net.model._blocks.11._se_expand.conv.weight: copying a param with shape torch.Size([576, 24, 1, 1]) from checkpoint, the shape in current model is torch.Size([672, 28, 1, 1]).
    size mismatch for backbone_net.model._blocks.11._se_expand.conv.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([672]).
    size mismatch for backbone_net.model._blocks.11._project_conv.conv.weight: copying a param with shape torch.Size([96, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 672, 1, 1]).
    size mismatch for backbone_net.model._blocks.11._bn2.weight: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.11._bn2.bias: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.11._bn2.running_mean: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.11._bn2.running_var: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.12._expand_conv.conv.weight: copying a param with shape torch.Size([576, 96, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 192, 1, 1]).
    size mismatch for backbone_net.model._blocks.12._bn0.weight: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn0.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn0.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn0.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._depthwise_conv.conv.weight: copying a param with shape torch.Size([576, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([1152, 1, 5, 5]).
    size mismatch for backbone_net.model._blocks.12._bn1.weight: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn1.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn1.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._bn1.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._se_reduce.conv.weight: copying a param with shape torch.Size([24, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.12._se_reduce.conv.bias: copying a param with shape torch.Size([24]) from checkpoint, the shape in current model is torch.Size([48]).
    size mismatch for backbone_net.model._blocks.12._se_expand.conv.weight: copying a param with shape torch.Size([576, 24, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 48, 1, 1]).
    size mismatch for backbone_net.model._blocks.12._se_expand.conv.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.12._project_conv.conv.weight: copying a param with shape torch.Size([96, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.12._bn2.weight: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.12._bn2.bias: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.12._bn2.running_mean: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.12._bn2.running_var: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.13._expand_conv.conv.weight: copying a param with shape torch.Size([576, 96, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 192, 1, 1]).
    size mismatch for backbone_net.model._blocks.13._bn0.weight: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn0.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn0.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn0.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._depthwise_conv.conv.weight: copying a param with shape torch.Size([576, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([1152, 1, 5, 5]).
    size mismatch for backbone_net.model._blocks.13._bn1.weight: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn1.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn1.running_mean: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._bn1.running_var: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._se_reduce.conv.weight: copying a param with shape torch.Size([24, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.13._se_reduce.conv.bias: copying a param with shape torch.Size([24]) from checkpoint, the shape in current model is torch.Size([48]).
    size mismatch for backbone_net.model._blocks.13._se_expand.conv.weight: copying a param with shape torch.Size([576, 24, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 48, 1, 1]).
    size mismatch for backbone_net.model._blocks.13._se_expand.conv.bias: copying a param with shape torch.Size([576]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.13._project_conv.conv.weight: copying a param with shape torch.Size([136, 576, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.13._bn2.weight: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.13._bn2.bias: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.13._bn2.running_mean: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.13._bn2.running_var: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.14._expand_conv.conv.weight: copying a param with shape torch.Size([816, 136, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 192, 1, 1]).
    size mismatch for backbone_net.model._blocks.14._bn0.weight: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn0.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn0.running_mean: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn0.running_var: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._depthwise_conv.conv.weight: copying a param with shape torch.Size([816, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([1152, 1, 5, 5]).
    size mismatch for backbone_net.model._blocks.14._bn1.weight: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn1.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn1.running_mean: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._bn1.running_var: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._se_reduce.conv.weight: copying a param with shape torch.Size([34, 816, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.14._se_reduce.conv.bias: copying a param with shape torch.Size([34]) from checkpoint, the shape in current model is torch.Size([48]).
    size mismatch for backbone_net.model._blocks.14._se_expand.conv.weight: copying a param with shape torch.Size([816, 34, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 48, 1, 1]).
    size mismatch for backbone_net.model._blocks.14._se_expand.conv.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.14._project_conv.conv.weight: copying a param with shape torch.Size([136, 816, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.14._bn2.weight: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.14._bn2.bias: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.14._bn2.running_mean: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.14._bn2.running_var: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([192]).
    size mismatch for backbone_net.model._blocks.15._expand_conv.conv.weight: copying a param with shape torch.Size([816, 136, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 192, 1, 1]).
    size mismatch for backbone_net.model._blocks.15._bn0.weight: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn0.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn0.running_mean: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn0.running_var: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._depthwise_conv.conv.weight: copying a param with shape torch.Size([816, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([1152, 1, 3, 3]).
    size mismatch for backbone_net.model._blocks.15._bn1.weight: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn1.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn1.running_mean: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._bn1.running_var: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._se_reduce.conv.weight: copying a param with shape torch.Size([34, 816, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.15._se_reduce.conv.bias: copying a param with shape torch.Size([34]) from checkpoint, the shape in current model is torch.Size([48]).
    size mismatch for backbone_net.model._blocks.15._se_expand.conv.weight: copying a param with shape torch.Size([816, 34, 1, 1]) from checkpoint, the shape in current model is torch.Size([1152, 48, 1, 1]).
    size mismatch for backbone_net.model._blocks.15._se_expand.conv.bias: copying a param with shape torch.Size([816]) from checkpoint, the shape in current model is torch.Size([1152]).
    size mismatch for backbone_net.model._blocks.15._project_conv.conv.weight: copying a param with shape torch.Size([136, 816, 1, 1]) from checkpoint, the shape in current model is torch.Size([320, 1152, 1, 1]).
    size mismatch for backbone_net.model._blocks.15._bn2.weight: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([320]).
    size mismatch for backbone_net.model._blocks.15._bn2.bias: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([320]).
    size mismatch for backbone_net.model._blocks.15._bn2.running_mean: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([320]).
    size mismatch for backbone_net.model._blocks.15._bn2.running_var: copying a param with shape torch.Size([136]) from checkpoint, the shape in current model is torch.Size([320]).
zylo117 commented 2 years ago

compound_coef should be the same as the weights'

santhoshnumberone commented 2 years ago

compound_coef should be the same as the weights'

Could you please explain what should be corrected and where?

Is this same as RuntimeError: Error(s) in loading state_dict for EfficientDetBackbone #557

zylo117 commented 2 years ago

set it to 3 if you load weights of effdet d3

santhoshnumberone commented 2 years ago

set it to 3 if you load weights of effdet d3

Thank you

efficientdet-d<number>.pth compound_coef=<number>