基于caffe的WEB demo

				版权声明:转载注明出处 http://blog.csdn.net/Real_Myth,如果发现有未完成的文章,请及时留言告知					https://blog.csdn.net/Real_Myth/article/details/52745712				</div>
							            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
					<div class="htmledit_views" id="content_views">

Web Demo

需要的条件

demo 需要Python支持和一些依赖,确保已经安装依赖,运行: pip install -r examples/web_demo/requirements.txt, 并确定已经编译了Python Caffe并且包含在PYTHONPATH 中(seeinstallation instructions).

确保已经下载了 Reference CaffeNet Model 和 the ImageNet Auxiliary Data:


  
  
  1. ./scripts/download_model_binary.py models/bvlc_reference_caffenet
  2. ./ data/ilsvrc12/get_ilsvrc_aux.sh

NOTE: 如果运行有问题,请尝试重新下载auxiliary files.

运行

执行 python examples/web_demo/app.py 将会启动demo服务, 本机访问地址http://0.0.0.0:5000.可以开启web server的debug模式 , 或者改变端口号:


  
  
  1. % python examples/web_demo/app.py -h
  2. Usage: app.py [options]
  3. Options:
  4. -h, --help show this help message and exit
  5. -d, --debug enable debug mode
  6. -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





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值