Sorry, please ignore this post. What I did was not meaningful. Plot_sched() only works after fitting not after lr_find().
I run this example code from tutorial (https://docs.fast.ai/tutorial.vision), plot_sched() failed with error message saying learn.hps does not exist. This seems like a bug.
----> 1 learn.recorder.plot_sched()
lib/python3.6/site-packages/fastai/callback/schedule.py in plot_sched(self, keys, figsize)
116 @patch
117 def plot_sched(self:Recorder, keys=None, figsize=None):
--> 118 keys = self.hps.keys() if keys is None else L(keys)
lib/python3.6/site-packages/fastcore/foundation.py in __getattr__(self, k)
157 if self._component_attr_filter(k):
158 attr = getattr(self,self._default,None)
--> 159 if attr is not None: return getattr(attr,k)
160 raise AttributeError(k)
161 def __dir__(self): return custom_dir(self,self._dir())
AttributeError: 'Learner' object has no attribute 'hps'
Source code:
from fastai.vision.all import *
path = untar_data(URLs.PETS)
files = get_image_files(path/"images")
def label_func(f): return f[0].isupper()
dls = ImageDataLoaders.from_name_func(path, files, label_func, item_tfms=Resize(224))
learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.lr_find()
learn.recorder.plot_sched()