Guillem96 / efficientdet-tf

Custom implementation of EfficientDet https://arxiv.org/abs/1911.09070
GNU General Public License v3.0
96 stars 23 forks source link

Load pretrain models other than D0 #13

Closed bessszilard closed 4 years ago

bessszilard commented 4 years ago

I tried to load a pretrained model with the D3 backbone. The code was:

model = EfficientDet.from_pretrained('D0-VOC', score_threshold=.3)

And I received this error:

---------------------------------------------------------------------------

AssertionError                            Traceback (most recent call last)

<ipython-input-20-3fc0c2111c96> in <module>()
----> 1 model = EfficientDet.from_pretrained('D2-VOC', score_threshold=.3)
      2 image_size = (model.config.input_size,) * 2

1 frame

/usr/local/lib/python3.6/dist-packages/efficientdet/models/efficientdet.py in from_pretrained(checkpoint_path, num_classes, **kwargs)
    151             checkpoint_path = AVAILABLE_MODELS[checkpoint_path]
    152 
--> 153         model, _ = load(checkpoint_path, **kwargs)
    154 
    155         if num_classes is not None:

/usr/local/lib/python3.6/dist-packages/efficientdet/utils/checkpoint.py in load(save_dir_or_url, **kwargs)
    101         model_path = Path(save_dir_or_url) / 'model.tf'
    102 
--> 103     assert hp_fname.exists()
    104 
    105     with hp_fname.open() as f:

AssertionError: 

I am doing something wrong, or this hasn't been implemented yet?

Guillem96 commented 4 years ago

I am working on more pretrained models, for now only the ones listed in the readme are available