Skip to content
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

what is model._make_predict_function() used for? #2

Closed
leckie-chn opened this issue Apr 3, 2017 · 2 comments
Closed

what is model._make_predict_function() used for? #2

leckie-chn opened this issue Apr 3, 2017 · 2 comments

Comments

@leckie-chn
Copy link

I am also working on multi-thread prediction on RL model. I've been stuck on this issue for about a week until I saw this line of your code:

model._make_predict_function()	# have to initialize before threading

So can you tell me what does this function do and why we need to add this line of code? I can't find any documentation about this.

@jaromiru
Copy link
Owner

jaromiru commented Apr 3, 2017

Hi,

_make_predict_function() is called only after a call to predict(). I believe this is a flaw in Keras design - this code is not synchronous and not thread ready. Thats why I need to call this function before threading.

It goes in conjunction with:
self.default_graph.finalize() # avoid modifications

I don't want to modify the model when running the computation.

@leckie-chn
Copy link
Author

Thank you! I put the same issue on Keras Github Repo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants