Oi vey …
Read the code a little more closely and figured out that learn.model
is different than learn.models.model
.
Revised code works:
xforms, _ = tfms_from_model(arch, sz)
im = xforms(Image.open(f'{PATH}/valid/in-n-out/2.jpg'))
preds = to_np(learn.models.model(V(T(im[None]).cuda())))
np.argmax(preds, axis=1)