Skip to content

Is there any way of loading the encoder from local path instead of downloading it? #957

Open
@Rafaelca70x

Description

@Rafaelca70x

I'm implementing the API on a website. I made a code that loads the model I trained and predicts on some images, but every time I load the model, the model start downloading the encoder weights. This slows down my tests. I downloaded the encoder so I was wondering if there was any way to load these weights by passing the path to the encoder?

modle_path = os.path.join(os.path.dirname(__file__), 'modelos_seg/model_dpl_efficientnet-b7') 
model = smp.from_pretrained(modle_path) # Load the pre-trained model
Downloading: "https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b7-dcc49843.pth" to /root/.cache/torch/hub/checkpoints/efficientnet-b7-dcc49843.pth
100%|██████████| 254M/254M [00:57<00:00, 4.67MB/s] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions