、ありがとうございました。 (type: "Python"
レイヤーhereを追加する例を参照してください)。 param_str
の詳細については
import sys, os
sys.path.insert(0, os.environ['CAFFE_ROOT']+'/python')
import caffe
class myInputLayer(caffe.Layer):
def setup(self,bottom,top):
# read parameters from `self.param_str`
...
def reshape(self,bottom,top):
# no "bottom"s for input layer
if len(bottom)>0:
raise Exception('cannot have bottoms for input layer')
# make sure you have the right number of "top"s
if len(top)!= ...
raise ...
top[0].reshape(...) # reshape the outputs to the proper sizes
def forward(self,bottom,top):
# do your magic here... feed **one** batch to `top`
top[0].data[...] = one_batch_of_data
def backward(self, top, propagate_down, bottom):
# no back-prop for input layers
pass
this threadを参照してください。
プリフェッチhereを使用して、データ読み込みレイヤーのスケッチを見つけることができます。
ご説明いただきありがとうございます。ここでコードを実装してください。 o(^▽^)o –
実際に私はcaffeのウェブサイトで1つのPRを見つけました。 https://github.com/BVLC/caffe/pull/3471/files –
ここでマルチスレッドを使用してデータを高速に読み込むことはできますか? – curio1729