0
import torch
from PIL import Image
import numpy as np
from effdet import get_efficientdet_config, EfficientDet


config = get_efficientdet_config('tf_efficientdet_d0')
model = EfficientDet(config, pretrained_backbone=True)
model.eval()

when I run this I am getting the error

Unexpected keys (bn2.bias, bn2.num_batches_tracked, bn2.running_mean, bn2.running_var, bn2.weight, classifier.bias, classifier.weight, conv_head.weight) found while loading pretrained weights. This may be expected if model is being adapted.

I researched some bit and got to know that this is because of timm builder but didn't find any solutions. How to fix this?

I wanted to load the efficientdet weights but it resulted in an unexpected keys error

1 Answer 1

0

Your code works without issues in my environment; I believe your huggingface_hub package is old. Try

python -m pip install --upgrade huggingface_hub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.