My kernel blocked so I was obliged to restart it - and now I want to save time (to skip the steps where I computed the weights) and I try to load the saved weights but I have this error
# Put these at the top of every notebook, to get automatic reloading and inline plotting
%reload_ext autoreload
%autoreload 2
%matplotlib inline
import torch
# This file contains all the main external libs we'll use
from fastai.imports import *
from fastai.transforms import *
from fastai.conv_learner import *
from fastai.model import *
from fastai.dataset import *
from fastai.sgdr import *
from fastai.plots import *
# ? Used Resnet34 since resnext didn’t load for some errors
sz=224
arch=resnet34
bs=24
data = get_data(sz,bs)
learn = ConvLearner.pretrained(arch,data, precompute=True) #, ps=0.5
learn.load('224_pre')
As I understand it, you have to explicitly create learn object and say learn.precompute = True/False whatever it was (when you saved the object) before loading the object.
I faced a similar error. I think if you saved it with precompute=True. You need to load it to a learn object which has precompute =False. And vice versa. ie. If you saved it with precompute=False, then load it into an object with precompute =True