TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
375 stars 77 forks source link

Misspelling the "Classifier" layer in pretrained model files #775

Closed mostafajahanifar closed 7 months ago

mostafajahanifar commented 8 months ago

Description

I noticed that there was a misspelling in the name of the classifier layer of the CNNModel class in the previous versions of the toolbox, where the classifier was spelled classifer. Therefore, all the previously saved pre-trained model weights have that spelling error. However, it seems that we have fix that spelling error in the code but have not updated the pretrained models. This will cause problems when loading any pretrained model.

What I Did

from tiatoolbox.models.engine.patch_predictor import PatchPredictor predictor = PatchPredictor(pretrained_model="googlenet-kather100k", batch_size=64)

I have tried with ResNet models, it will generate the same error.

My suggestion is to update all the pretrained weight files for this mistake. Basically, the "classifer.weights" and "classifer.bias" should be updated to "classifier.weights" and "classifier.bias", respectively.

mostafajahanifar commented 7 months ago

I'm closing this issue because of noticed I detected this issue using an older version of the toolbox, not the latest. So, TIAToolbox v1.5 works just fine. Sorry about the false alarm!

I'm closing this issue.