I am trying to predict single image. The trained model on colab and it is stored using learn.export() at dataPath. The same is loaded on pc using learn = load_learner(dataPath). I am getting following warning on loading the learner:
C:\Users\XXXX\Miniconda3\envs\fastai_v1\lib\site-packages\torch\serialization.py:434: SourceChangeWarning: source code of class ‘torch.nn.modules.loss.CrossEntropyLoss’ has changed. you can retrieve the original source code by accessing the object’s source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
- warnings.warn(msg, SourceChangeWarning)*
C:\Users\XXXX\Miniconda3\envs\fastai_v1\lib\site-packages\torch\serialization.py:434: SourceChangeWarning: source code of class ‘torch.nn.modules.conv.Conv2d’ has changed. you can retrieve the original source code by accessing the object’s source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. - warnings.warn(msg, SourceChangeWarning)*
C:\Users\XXXX\Miniconda3\envs\fastai_v1\lib\site-packages\torch\serialization.py:434: SourceChangeWarning: source code of class ‘torch.nn.modules.batchnorm.BatchNorm2d’ has changed. you can retrieve the original source code by accessing the object’s source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. - warnings.warn(msg, SourceChangeWarning)*
C:\Users\XXXX\Miniconda3\envs\fastai_v1\lib\site-packages\torch\serialization.py:434: SourceChangeWarning: source code of class ‘torch.nn.modules.activation.ReLU’ has changed. you can retrieve the original source code by accessing the object’s source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. - warnings.warn(msg, SourceChangeWarning)…*
…
I am loading the dummy ImageDataBunch using data = ImageDataBunch.single_from_classes(dataPath, classes, ds_tfms=tfms, size=224).normalize(imagenet_stats).
I am acquiring the image g using open_image(“sampleimage.jpg”)
On running prediction cat, indice, preds = learn.predict(g) I get the error:
AttributeError: ‘ReLU’ object has no attribute ‘threshold’
Looks like a version issue. Any solutions??