Right now, when I need to load a pre-trained image model, I just do it this way-
learn = cnn_learner(
dls,
arch,
loss_func=loss_func,
metrics=some_metrics
)
What this triggers is, the ImageNet pre-trained model is downloaded and that’s how the learner is created.
But it requires internet access. Without internet access, this doesn’t work.
What I do is, I notice the path into which the .pth
file is attempted to be downloaded. I manually download the .pth
file from another computer and then put it to the directory the learner would look for in. It is usually- /root/.cache/torch/hub/checkpoints/
.
If I do this, it works without the internet. But it is manual and quite messy. Isn’t there a better way to do it?
I want to work like an architecture, not a learner in itself. If I use the .load_learner()
method, then it is the learner in itself. I don’t want that.
Please suggest what I should do.