Open fffupeng opened 6 years ago
Clone and replace the input_variable with one with fixed dimensions?
Does it mean i can change input vector's shape to set my input data shape? But the input vector's dimension is equal to the batch size. It will be so kind of you to show me some codes about how to set input shape.
Batch size is considered dynamic regardless of FreeDimension. You could have a model with fixed input shape, but eval with different batch size on each invocation. Note that in CNTK when we talking about variable shape, it's the sample shape not including sequence/batch axis which is called dynamic axes.
FreeDimension means the dimension in variable shape could change from input to input. The actual variable shape would be inferred at runtime (with some perf cost). So if you are using FreeDimension, there is no need to fix input/output variable shape.
Codes are as follows. When i use cntk c++ api. data vector is created from data point. Then, inputvar and outputvar can be get from model loaded. But i want to set my own shape like (NDShape({ 1,28,28 }). Saddly, it not right. Programs run with errors. By the way , my dnn model's input is free dimension.
` std::vector inputData(NDShape({ 1,28,28 }).TotalSize());
for (size_t i = 0; i < inputData.size(); i++)
inputData[i] = inputdata_m[i];
How can i fix input or output shape when my dnn model's input is free dimension?