learn = cnn_learner( dl, resnet34, metrics=error_rate)
cb = TestCallback(learn) #this prints “Init”
learn.add_cb(cb) #AttributeError: ‘Learner’ object has no attribute ‘name’
Is my function within the callback class (on_train_begin) right or do I need to change the name of the function?
How do I add a custom callback to the cnn_learner object? My way of adding gives ‘Atttribute Error’. Further, this line too seems to not work: learn.fit_one_cycle(2, cbs = cb)
When creating a cnn_learner object, I see there is a property called “cbs”. When creating a cnn_learner object, the callbacks I pass to this cbs property should be the ones that do not require a learner object?
Hi @all, I am trying to use the pseudo labels before putting them in forward function. I am trying to use callbacks for it:
"A Callback that sends targ to model and adjusts teacher forcing ratio"
#def __init__(self): self.teacher_forcing_ratio = teacher_forcing_ratio
x,y = self.x, self.y
But I am having this error:
TypeError: forward() takes 2 positional arguments but 3 were given
If I assign separately to self.learn.yb, then error is that 5 arguments are given, while 2 are expected.