caffe web demo 搭建
Web Demo
需要的條件
demo 需要Python支持和一些依賴,確保已經安裝依賴,運行: pip install -r examples/web_demo/requirements.txt, 并確定已經編譯了Python Caffe并且包含在PYTHONPATH 中(seeinstallation instructions).
確保已經下載了 Reference CaffeNet Model 和 the ImageNet Auxiliary Data:
./scripts/download_model_binary.py models/bvlc_reference_caffenet ./data/ilsvrc12/get_ilsvrc_aux.shNOTE: 如果運行有問題,請嘗試重新下載auxiliary files.
運行
執行 python examples/web_demo/app.py 將會啟動demo服務, 本機訪問地址http://0.0.0.0:5000.可以開啟web server的debug模式 , 或者改變端口號:
% python examples/web_demo/app.py -h Usage: app.py [options]Options:-h, --help show this help message and exit-d, --debug enable debug mode-p PORT, --port=PORT which port to serve content on“maximally accurate” 結果如何產生?
In a nutshell: ImageNet predictions are made at the leaf nodes, but the organization of the project allows leaf nodes to be united via more general parent nodes, with ‘entity’ at the very top.To give “maximally accurate” results, we “back off” from maximally specific predictions to maintain a high accuracy.The bet_file that is loaded in the demo provides the graph structure and names of all relevant ImageNet nodes as well as measures of information gain between them.Please see the “Hedging your bets” paper fromCVPR 2012 for further information.
界面展示
問題和解決
1 問題
Traceback (most recent call last):
? File "./scripts/download_model_binary.py", line 5, in <module>
??? import yaml
ImportError: No module named yaml
解決:sudo apt-get install python-yaml
2 問題
python examples/web_demo/app.py
Traceback (most recent call last):
? File "examples/web_demo/app.py", line 6, in <module>
??? import flask
ImportError: No module named flask
解決:sudo apt-get install python-flask
3 問題
Traceback (most recent call last):
? File "examples/web_demo/app.py", line 9, in <module>
??? import tornado.wsgi
ImportError: No module named tornado.wsgi
解決:sudo apt-get install python-tornado
4 問題
Traceback (most recent call last):
? File "examples/web_demo/app.py", line 12, in <module>
??? import pandas as pd
ImportError: No module named pandas
解決:sudo apt-get install python-pandas
5 問題
Traceback (most recent call last):
? File "examples/web_demo/app.py", line 18, in <module>
??? import caffe
ImportError: No module named caffe
解決:
pls import caffe in $CAFFE/python or add the path to sys.path
總結
以上是生活随笔為你收集整理的caffe web demo 搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Caffe: LMDB 及其数据转换
- 下一篇: 几种常用的图像处理函数库