learn = create_cnn(data, models.resnet34, metrics=accuracy)
learn.predict(img)
img is a numpy.ndarray
import numpy as np
item=ItemBase(Tensor(np.rollaxis(img,2)))
learn.predict(item)
Exception: Not implemented: you can't apply transforms to this type of item (ItemBase)
Thanks, It’s very neat. By the way, How do you know such thing like this? The docs_src notebook? I’m confused about “Image” can do transforms things.
Here, if you do type(img) you will get fastai.vision.image.Image. By this I know predict() expects Image which inherits ItemBase, I saw it in the source code. If the code is giving bugs then going through inner code clears lots of them.