惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

Caffe

种草了 GENE CAFE 烘豆机,想尝试一下自己烘豆,各位 V 友有使用过这台机器的吗? - V2EX 分享一个 Caffe2 on iOS 的 demo project 新手试运行了一个 caffe 的 Python 代码,出现这个错误是怎么回事? - V2EX 请问谁有 pycaffe 的教程或者 reference? - V2EX 有人翻译过 caffe 框架的那篇论文么 - V2EX 关于 caffe 中卷积层 filter 的一个小疑问,求解答~~~~ - V2EX Caffe 里 set_phase_test 是在新版本更名了吗? - V2EX
caffe 能不能把 transformer 进行“持久化”存储下来?以免每次加载都很耗时
Reign · 2017-04-27 · via Caffe

这是一个创建于 3334 天前的主题,其中的信息可能已经有所发展或是发生改变。

caffe 中示例的如下代码:
import numpy as np
import sys,os
caffe_root = '/opt/caffe/'
sys.path.insert(0, caffe_root + 'python')
import caffe
os.chdir(caffe_root)
net_file=caffe_root + 'deploy.prototxt'
caffe_model=caffe_root + 'test.caffemodel'
mean_file=caffe_root + 'mean.npy'
net = caffe.Net(net_file,caffe_model,caffe.TEST)
transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})
transformer.set_transpose('data', (2,0,1))
transformer.set_mean('data', np.load(mean_file).mean(1).mean(1))
transformer.set_raw_scale('data', 255)
transformer.set_channel_swap('data', (2,1,0))
#把 transformer 持久化存储下来
im=caffe.io.load_image(caffe_root+'/sample/1.jpg')
net.blobs['data'].data[...] = transformer.preprocess('data',im)
out = net.forward()
print out
服务器没 GPU,每次加载一个 transformer 非常耗时,我就在想只加载一次,能不能持久化把这个 transformer 存储下来,以后每次测试图片直接调用就行了?
另外,如果使用别人已经建立好了的 caffemodel 来测试,是不是有了 GPU 会更快些?
机器学习新手问题估计比较幼稚,还是先谢谢了

thomaspaine

1

thomaspaine      2017 年 4 月 28 日

python 自己的序列化反序列化不行吗?