diff options
author | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2015-03-07 12:53:34 -0800 |
---|---|---|
committer | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2015-03-08 00:24:27 -0800 |
commit | 11730440d048f5ae6e120926ddaf042c8ec4cc73 (patch) | |
tree | 547ee83afb3023ea7083664274e48484600fc37c /examples | |
parent | 124f6ef1a518ff8701302b368b827ca0912a29ca (diff) | |
download | caffeonacl-11730440d048f5ae6e120926ddaf042c8ec4cc73.tar.gz caffeonacl-11730440d048f5ae6e120926ddaf042c8ec4cc73.tar.bz2 caffeonacl-11730440d048f5ae6e120926ddaf042c8ec4cc73.zip |
[example] warm-start web demo
call forward to warm-start the demo so the first request isn't slow.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/web_demo/app.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/web_demo/app.py b/examples/web_demo/app.py index 208b1da0..bbeff5eb 100644 --- a/examples/web_demo/app.py +++ b/examples/web_demo/app.py @@ -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) |