Hello Guys,
In the book Chapter 19 Fastai Learner from Scratch, I got an error in the below section of the code in Colab. Is the error due to a version of fastai or fastcore?
learn = Learner(simple_cnn(), dls, cross_entropy, lr=0.1, cbs=cbs)
AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 learn = Learner(simple_cnn(), dls, cross_entropy, lr=0.1, cbs=cbs)
1 frames
in init(self, model, dls, loss_func, lr, cbs, opt_func)
1 class Learner:
2 def init(self, model, dls, loss_func, lr, cbs, opt_func=SGD):
----> 3 store_attr(self, ‘model, dls, loss_func, lr, cbs, opt_func’)
4 for cb in cbs: cb.learner = self
5
/usr/local/lib/python3.10/dist-packages/fastcore/basics.py in store_attr(names, self, but, cast, store_args, **attrs)
398 else: self = fr.f_locals[args[0]]
399 if store_args is None: store_args = not hasattr(self,‘slots’)
→ 400 if store_args and not hasattr(self, ‘stored_args’): self.stored_args = {}
401 anno = annotations(self) if cast else {}
402 if names and isinstance(names,str): names = re.split(‘, *’, names)
AttributeError: ‘str’ object has no attribute 'stored_args