TensorFlow Transfer Learning, Functional API, model.predict returns always same class. #567
AdrianKazii
started this conversation in
General
Replies: 1 comment
-
having the same issue with EfficentNetB0. the metrices are good but still it predicts meso_soup everytime |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an issue with model.predict. I run feature extraction model, then fine tuning with Functional API. Training looks good, loss and accuracy curves show that model is learning, evaluation in a range of 87-91%. But then when I try to plot the image either with pred_and_plot function from helper_functions from up here https://github.com/mrdbourke/tensorflow-deep-learning/blob/main/extras/helper_functions.py:
or I use custom code:
For custom code where image is randomly picked I always get 1 class as prediction but always new image on a plot. I've checked the pred, pred.argmax() and I always get almost the same predictions for 10 class classification:
pred.argmax():
[[0.07503171 0.11896327 0.12848163 0.09343361 0.04384859 0.02784183 0.26499084 0.11767029 0.09404188 0.03569638]]
pred:
6
"Almost the same" means that the prediction is always done, because I get slightly different numbers, e.g. instead
0.0751232
I get0.0703171
in 0 index. Thus, it seems that model constantly predicts one image and display another one. Did anyone have the same issue, is it something with my code, Functional API or...? Just to add I used transfer learning previously with Sequential and didn't have that issue.Beta Was this translation helpful? Give feedback.
All reactions