How to feed matrix vector into a splitted pre-trained network
1 次查看(过去 30 天)
显示 更早的评论
I am using alexnet, you can see the structure of the network as following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169901/image.jpeg)
I used the activations function in Matlab to get the features from the output of conv5 layer. The output is a feature vector with a dimension 43264 for each single image (I have 14000 Images).
I did some processing on this output with no change in the dimension so it still 43264.
Then, I wanted to feed this matrix into the next layer which is MAX POOL3.
As you can notice in the structure of alexnet, the input of the pooling3 should be 13x13x256. So I changed the feature vector 14000X43264 to a cell array 14000x1 each cell has 13x13x256.
I used the following code to train the network:
net = trainNetwork (Data, Datalabels, Layers, trainingOptions)
I still has an error saying unexpected input to Pooling layer! as following:
Error using nnet.internal.cnn.layer.util.inferParameters>iInferSize (line 86) The output of layer 1 is incompatible with the input expected by layer 2.
Any I idea please?
Thanks in advance
1 个评论
Bernhard Suhm
2018-2-11
If you were still interested in getting an answer, can you provide the code how you defined these layers?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!