is compile really necessary when we predict using a pretrained model? #3074

Closed
dongzhuoyao opened this Issue Jun 26, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@dongzhuoyao

I search a result from stackoverflow:

http://stackoverflow.com/questions/33474424/keras-load-weights-of-a-neural-network-error-when-predicting

it says you must compile before predict,but in my current keras version,I remove the compile code block,and then also get a good predict result.

from my opinion,when we predict ,we just do forward-propogation rather than back-propogation,so we dont need know what the loss is and how the loss is comprised of.so for a better architecture design,we shouldnt need "compile".

so finally,i want to confirm whether we need "complie" before we "predict"??yes or no

@ChristianThomae

This comment has been minimized.

Show comment
Hide comment
@ChristianThomae

ChristianThomae Jun 26, 2016

Since this commit d8864bf or keras version 1.0.3 it is no longer necessary to compile the model to use predict.

Since this commit d8864bf or keras version 1.0.3 it is no longer necessary to compile the model to use predict.

@fchollet fchollet closed this Jun 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment