extract features and pass to svm for classification

i want to extract features of my dataset and pass it to svm for classification. when i use pretrain alexnet and do feature extraction then code work well and give me result. but i want to replace pretrained alexnet with mnist dataset (mnist model that i have save already by transfer learning of mnist data from scratch). when i load mnist data and then do feature extraction process then code gives me error ( activations(net,trainingImages,layer); activations(net,testImages,layer); give error in these lines that is in activations). here i attach the code please guide me how to remove the error and what is issue

4 Kommentare

Could you please post the exact error you get or attach the pretrainedmnist.mat file, so we could know what error you get?
To my knowledge, the MNIST data set contains images of the 28 x 28 resolution, while AlexNet was trained on 224 x 224 images. You won't be able to do transfer learning effectively without re-scaling the images.
when we rescale images then again it give error
hey..i want to also use Alexnet + SVM .So, can i get your coding.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

amina naseer
amina naseer am 18 Jul. 2018
Bearbeitet: amina naseer am 18 Jul. 2018

0 Stimmen

Giridharan Kumaravelu sir this is error image

3 Kommentare

Giridharan Kumaravelu
Giridharan Kumaravelu am 18 Jul. 2018
Bearbeitet: Giridharan Kumaravelu am 18 Jul. 2018
It looks like the loaded pretrained model may not be in the correct format for the written code. Could you please attach the mat files containing the alexnet and pretrainedmnistnet ?
Giridharan Kumaravelu sir could you please share your email address so that i will mail files on it. the file is of larger size so that not attached here. please share email
Giridharan Kumaravelu
Giridharan Kumaravelu am 24 Jul. 2018
Bearbeitet: Giridharan Kumaravelu am 24 Jul. 2018
I am not in a position to receive any files. But you could look into this example https://mathworks.com/help/nnet/examples/transfer-learning-using-alexnet.html where it is explained what you are trying to do. As Alpha Bravo mentioned, this could be a dimension mismatch problem. Please check the third dimension of your image too.

Melden Sie sich an, um zu kommentieren.

Tags

Gefragt:

am 18 Jul. 2018

Kommentiert:

am 25 Feb. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by