ashkamath / mdetr

Apache License 2.0
967 stars 125 forks source link

loading lvis model in colab #5

Open nikky4D opened 3 years ago

nikky4D commented 3 years ago

Hi,

Is there a sample on how to load the lvis model in colab, similar to what is currently done with torch.hub?

nikky4D commented 3 years ago

I can follow the format in hubconf.py. Is the backbone for the LVIS model also a Resnet101? I'm making something like this, however it is throwing errors:

`

def mdetr_resnet101_lvis(pretrained=False, return_postprocessor=False):

model = _make_detr("resnet101")
if pretrained:
    checkpoint = torch.hub.load_state_dict_from_url(
        url="https://zenodo.org/record/4721981/files/lvis10_checkpoint.pth",
        map_location="cpu",
        check_hash=True,
    )
    model.load_state_dict(checkpoint["model"])
if return_postprocessor:
    return model, PostProcess()
return model

`