Clear Filters
Clear Filters

Errors While Trying To Extract Images Features using Pretrained AlexNet Model

2 views (last 30 days)
hello I have 273 grayscale Images (Drone) and I want to Apply Faster R-CNN model to Classify Objects in images, but in first I used A Pretrained AlexNet Model for Increase Speed of my project, But in while trying To Extract Images Features using Pretrained AlexNet Model and writing below codes from Mathworks site (www.mathworks.com/help/deeplearning/ref/alexnet.html - Extract Image Features )
layer = 'fc7';
featuresTrain = activations(net,augimdsTrain,layer,'OutputAs','rows');
featuresTest = activations(net,augimdsTest,layer,'OutputAs','rows');
Matlab showed Below errors:
Error using nnet.internal.cnn.validateMiniBatchDatastore>checkPartitionByIndex (line 90)
Incorrectly defined MiniBatchable Datastore. Error in partitionByIndex method of F:\Program
Files\MATLAB\R2018a\toolbox\nnet\cnn\+nnet\+internal\+cnn\ImageDatastoreMiniBatchDatastore.m at line 59:
Undefined function 'categories' for input arguments of type 'double'.
Error in nnet.internal.cnn.validateMiniBatchDatastore (line 16)
checkPartitionByIndex(ds);
Error in nnet.internal.cnn.DataDispatcherFactory.createDataDispatcher (line 67)
nnet.internal.cnn.validateMiniBatchDatastore(inputs);
Error in SeriesNetwork>iDataDispatcher (line 1112)
dispatcher = nnet.internal.cnn.DataDispatcherFactory.createDataDispatcher( ...
Error in SeriesNetwork/activations (line 790)
dispatcher = iDataDispatcher( X, miniBatchSize, precision, ...
Error in myprj (line 24)
featuresTrain = activations(net,augimdsTrain,layer,'OutputAs','rows');
Can AnyOne Help Me?
  1 Comment
Mark Sherstan
Mark Sherstan on 12 Dec 2018
I remember getting a similar error when I did not resize my images to 227-by-227. Here is some code that I wrote that you could try your data on here and my resize and images processing function here.

Sign in to comment.

Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!