kentsommer / keras-inceptionV4

Keras Implementation of Google's Inception-V4 Architecture (includes Keras compatible pre-trained weights)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running under TensorFlow version: 1.2.0

CeadeS opened this issue · comments

Hello,

when running under TensorFlow version: 1.2.0 the output of evaluate_image.py is:

Class is: African elephant, Loxodonta africana
Certainty is: 0.775282

There are slight changes to how concat works in tf in comparison to keras. Is this a problem?

I have now evaluated imagenet and it resulted in a @1error of 0.26176. Do you have any suggestions or a code that achieves the numbers from the paper?

Hi @CeadeS,

I've been in the US for the past two weeks and haven't been checking github during that time so my apologies for the late response!

The changes to concat happened back in TF 1.0 I believe and have been integrated into Keras properly since then so that should not be a source of issues.

A couple things I would try which yielded the results listed on the readme for this repository:

  • Subtract 1.0 instead of 0.5:
def preprocess_input(x):
    x = np.divide(x, 255.0)
    x = np.subtract(x, 0.5)
    x = np.multiply(x, 2.0)
    return x
  • Ensure you are using the proper blacklisted version of imagenet (there are some images that should not be included in testing)

If you are still unable to get results close to the results listed on the readme, please let me know and I will look into this more!

Hi @kentsommer ,

i solved the problem. There was a problem with color order of cv2 and PIL. Keras ImageDataGenerator usew PIL and your code uses cv2. Therefore i had to think off the color order first. No i achieve 19.7% Accuracy that is pretty much the same as slim reports.

Subtract 0.5 should be the right number.

The blacklisted imagenet validation dataset should be -0.3% accuracy difference towards the not blacklisted dataset.

Thank you for your response on that.