VQA_Keras icon indicating copy to clipboard operation
VQA_Keras copied to clipboard

NameError: name 'img_norm' is not defined

Open correiav opened this issue 7 years ago • 1 comments

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!

correiav avatar Jul 05 '18 13:07 correiav

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.

iamaaditya avatar Jul 06 '18 20:07 iamaaditya