在pycaffe中使用net.forward时从lmdb的第一个开始转发 [英] Forward from the first of lmdb when using net.forward in pycaffe

查看:248
本文介绍了在pycaffe中使用net.forward时从lmdb的第一个开始转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pycaffe,并且我的火车和测试数据为LMDB格式.

I am using pycaffe and my train and test data is in LMDB format.

我创建了这样的网络: net = caffe.Net('train.prototxt','c.caffemodel',caffe.TEST)

I have created my net like this: net = caffe.Net('train.prototxt', 'c.caffemodel', caffe.TEST)

在调用net.forward时,隐式地一步一步地遍历了LMDB测试数据库.我的问题是如何从LMDB的开头开始,并在前n批测试数据中测试网络?

when you call net.forward, implicitly you walk through the LMDB test database one by one batches. My question is how can I start from the beginning of LMDB and test my network on the first n batches of the test data?

谢谢

推荐答案

不确定它是否仍然有用,但是您需要更改输入层的数据,例如net.params['data'][0].data[...] =net.params['data'][0].data[n,:,:,:]

not sure it still relevant but you would need to change the data of input layer ,something like this net.params['data'][0].data[...] =net.params['data'][0].data[n,:,:,:]

这篇关于在pycaffe中使用net.forward时从lmdb的第一个开始转发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆