Is it possible to change the input source of ImageData
layer or a MemoryData
layer on the fly?
I am trying to shuffle the data every epoch but I have both image and some other non-image features that I want to concatenate at a later stage in the network. I could not find a reliable way to shuffle both the image and my other data in a way that preserves the alignment of the two.
So, I am thinking of re-generating the imagelist.txt
as well as nonimage data (in Memory) every epoch and attach the new file to the ImageData
layer and initialize MemoryDataLayer
with the new data.
How can I make sure that I re-initialize the network with the new text file without restarting the training process. (I want the network to continue training at the same stage, momentum etc.., only start reading the image files from new file instead of one that was originally compiled).
layer {
name: "imgdata"
type: "ImageData"
top: "imgdata"
top: "dlabel"
transform_param {
# Transform param here
}
image_data_param {
source: "path to imagelist.txt" ## This file changes after n iterartions
batch_size: XX
new_height: XXX
new_width: XXX
}
}
And Similarly, I want to be able to copy the re-shuffled data into MemoryData
layer. Can I call Net.set_input_arrays
during middle of training?
layers {
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param {
batch_size: XX
channels: X
height: XXX
width: XXX
}