walkwithfastai.github.io icon indicating copy to clipboard operation
walkwithfastai.github.io copied to clipboard

Something strange in timm.py

Open santialferez opened this issue 4 years ago • 1 comments

Hi,

Thank you for your amazing work with wwf!

I think that there's something strange in L49, because the third input of create_timm_model is cut, but in that line is default_split.

There isn't an error because in L29 the parameter cut is forced to be None

Best

santialferez avatar May 28 '21 03:05 santialferez

Also in https://walkwithfastai.com/vision.external.timm there is an error in:

frozen = filter(lambda p: not p.requires_grad, learn.model.parameters())
frozen = sum([np.prod(p.size()) for p in unfrozen_params])
model_parameters = filter(lambda p: p.requires_grad, learn.model.parameters())
unfrozen = sum([np.prod(p.size()) for p in model_parameters])

It should be:

unfrozen_params = filter(lambda p: not p.requires_grad, learn.model.parameters())
frozen = sum([np.prod(p.size()) for p in unfrozen_params])
model_parameters = filter(lambda p: p.requires_grad, learn.model.parameters())
unfrozen = sum([np.prod(p.size()) for p in model_parameters])

santialferez avatar May 28 '21 03:05 santialferez