I search a result from stackoverflow:
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
Since this commit https://github.com/fchollet/keras/commit/d8864bfe48d64c15dc70f13e46c7e08772811fd9 or keras version 1.0.3 it is no longer necessary to compile the model to use predict.
I read that to profile keras (and TF) I need to enable trace for TF session as shown here. But, after this (https://github.com/keras-team/keras/issues/3074), compile is not necessary for calling predict. I am not sure how to pass run_metadata options for timeline. can you please help?
Most helpful comment
Since this commit https://github.com/fchollet/keras/commit/d8864bfe48d64c15dc70f13e46c7e08772811fd9 or keras version 1.0.3 it is no longer necessary to compile the model to use predict.