Closed frost-is closed 2 years ago
@frost-is - Thanks for raising the issue and providing code snippets.
Performance issue you observe in resnet_v2
is due to the missing step of preprocess_input
that squashes the inputs to -1 to 1. MobileNetV3Small
model has an optional parameter include_preprocessing
that you set to True
so you don't need any additional step to pre-process input.
Please apply the preprocess_input
in your resnet_v2
pipeline and let us know if you still see any degradation in accuracy metric.
Docs: https://www.tensorflow.org/api_docs/python/tf/keras/applications/resnet_v2/preprocess_input https://keras.io/api/applications/resnet/
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.
System information.
Describe the problem.
Hi,
I have recently begun tinkering with ILSVRC2012. I have noticed that some of the pretrained models that keras offers infer random noise.
I haven't tried everything, but on my setup, Mobilenetv3 Small, MobileNetV3 Large and EfficientNetv2 S work fine, with train accuracies over 70%. However, Inception ResnetV2, NasNet Mobile and NasNet Large have train accuracies of just about 0.1%.
The functions I use to import the models are the same as in the keras documentation
(I only infer on 1000 images on this example but it is the same when infering on the entire dataset)
The outputs I get are
1000/1000 - 10s - loss: 1.0272 - accuracy: 0.7647 - 10s/epoch - 10ms/step
for mobilenet and1000/1000 - 47s - loss: 1020.6038 - accuracy: 7.1875e-04 - 47s/epoch - 47ms/step
for InceptionResnetv2If you need to experiment on my code I'll try to create a colab - hopefully it's just a problem with the backend loading wrong weights.
Thank you very much for your time !