New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

dongzhuoyao opened this Issue Jun 26, 2016 · 2 comments


None yet
4 participants
Copy link

dongzhuoyao commented Jun 26, 2016

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 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


This comment has been minimized.

Copy link

ChristianThomae commented 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.

@fchollet fchollet closed this Jun 27, 2016


This comment has been minimized.

Copy link

rohith14 commented Nov 29, 2018

I read that to profile keras (and TF) I need to enable trace for TF session as shown here. But, after this (#3074), compile is not necessary for calling predict. I am not sure how to pass run_metadata options for timeline. can you please help?

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