iamaaditya / VQA_Keras

Modular and Simple approach to VQA in Keras
22 stars 10 forks source link

NameError: name 'img_norm' is not defined #6

Open correiav opened 6 years ago

correiav commented 6 years ago

Hi @iamaaditya, I tried to run the train.py however I got the following error: NameError: name 'img_norm' is not defined Which refers to the lines 53 and, possibly, 98 of the utils/get_data.pyscript, where you state image normalisation must occur. Could you briefly explain why to normalise image features and how to fix this issue?

Also, the train.py should import get_test_data from utils.get_data however the function on utils is actually defined as get_data_test, so I believe it's just a small typo to fix.

Thank you so much!

iamaaditya commented 6 years ago

Yes, you are right img_norm is defined here https://github.com/iamaaditya/VQA_Keras/blob/d6999208fa52d6259f98518027d99d813e05bb12/utils/get_data.py#L53 Image normalization is required because the CNN (VGG16) was trained with normalized images. Thus, in order to get the maximum benefit from the classifier test images should also be normalized. Think about what the biases do in the neural network. If your bias is wrong even if the neurons are doing the correct computation the overall score will be bad.

Could you do the fix for the get_test_data and send a pull request. I will be happy to accept it.