Skip to content

Commit

Permalink
[example] warm-start web demo
Browse files Browse the repository at this point in the history
call forward to warm-start the demo so the first request isn't slow.
  • Loading branch information
shelhamer committed Mar 8, 2015
1 parent 6b88f15 commit 2e85326
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/web_demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ def start_from_terminal(app):
opts, args = parser.parse_args()
ImagenetClassifier.default_args.update({'gpu_mode': opts.gpu})

# Initialize classifier
# Initialize classifier + warm start by forward for allocation
app.clf = ImagenetClassifier(**ImagenetClassifier.default_args)
app.clf.net.forward()

if opts.debug:
app.run(debug=True, host='0.0.0.0', port=opts.port)
Expand Down

0 comments on commit 2e85326

Please sign in to comment.