I’m sorry to make you confused. The
batch_size = 100 in script stand for the number of input images rather than tuning times. The tuning time is
n_trial = 2 in line 62.
I have run the “mobilenetv2.h5” model with tuning 2 time, The bug also appear, This bug may not be related with model.
After that, I only change the number of tuning(4, 8, 10) and get some different results below(testing on 2 images).
tuning times =4:
tuning 10 times:
np.testing.assert_allclose() passed!!! —> the model can predict the 2 images very well.
From the above results, we can find that with the increase of the tuning times, the Mismatch elements decreases gradually【100%–> 39.6%–>0%】
When checking the prediction probability of each classification, I find that when the number of tuning is 2, the prediction probability values for each classification are almost similar.
With the increasing number of tuning, the prediction value for correct classification gradually increases.