Reference to the nonexistent field 'imdb'.

I want to change the dataset from 'cuhk03.mat' dataset to 'cuhk03_detected_lomo.mat'(the‘cuhk03_detected_lomo.mat' is a dataset which has been processed with LOMO characteristics ),but it has an error when i run the same program,it shows:
% Reference to the nonexistent field 'imdb'
% wrong in train_id_net_res_2stream (line 8)
imdb = imdb.imdb;
I don't understand Why did it go wrong when i just change the dataset. The complete code is as follows:
% function train_id_net_res_2stream(varargin)
% -------------------------------------------------------------------------
% Part 4.1: prepare the data
% -------------------------------------------------------------------------
% Load character dataset
imdb = load('F:\2016_person_re-ID-master\2016_person_re-ID-master\cuhk03-prepare-eval/cuhk03_detected_lomo.mat') ;
imdb = imdb.imdb;
% -------------------------------------------------------------------------
% Part 4.2: initialize a CNN architecture
% -------------------------------------------------------------------------
net = resnet52_2stream();
net.params(net.getParamIndex('fc751f')).learningRate = 0.01;
net.params(net.getParamIndex('fc751b')).learningRate = 0.2;
net.conserveMemory = true;
net.meta.normalization.averageImage = reshape([105.6920,99.1345,97.9152],1,1,3);
% -------------------------------------------------------------------------
% Part 4.3: train and evaluate the CNN
% -------------------------------------------------------------------------
opts.train.averageImage = net.meta.normalization.averageImage;
opts.train.batchSize = 30;
opts.train.continue = true;
opts.train.gpus = 1; %Select gpu card. The gpu id in Matlab start from 1.
opts.train.prefetch = false ;
opts.train.expDir = './data/resnet52_2stream_drop0.9_new1' ; % your model will store here
opts.train.learningRate = [0.1*ones(1,70),0.01*ones(1,5)] ;
opts.train.derOutputs = {'objective', 0.5,'objective_2', 0.5,'objective_final', 1} ;
opts.train.weightDecay = 0.0005;
opts.train.numEpochs = numel(opts.train.learningRate) ;
[opts, ~] = vl_argparse(opts.train, varargin) ;
% Call training function in MatConvNet
[net,info] = cnn_train_dag(net, imdb, @getBatch,opts) ;
I'd appreciate it if you could give me some advice.Thank you!
supplement:
When i take the semicolon off the end of the load() line,it shows:
% imdb =
descriptors: [26960x14097 double]
imgList: {14097x1 cell}
note: '1_001_1_01.png means the 1st set, the 001th person, the 1st camera, and the…'
Reference to the nonexistent field 'imdb'
wrong in train_id_net_res_2stream (line 8)
imdb = imdb.imdb;
I'm so sorry that the mat file is so big that i can not attach it with the paper clip icon.

4 个评论

What's file? The file about LOMO feature extraction ?
Take the semicolon off the end of the load() line and tell us what it shows in the command window when that line executes. Also, attach the mat file with the paper clip icon.
When i take the semicolon off,it shows:
% imdb =
descriptors: [26960x14097 double]
imgList: {14097x1 cell}
note: '1_001_1_01.png means the 1st set, the 001th person, the 1st camera, and the…'
% Reference to the nonexistent field 'imdb'
% wrong in train_id_net_res_2stream (line 8)
imdb = imdb.imdb;
I'm so sorry that the mat file is so big that i can not attach it with the paper clip icon

请先登录,再进行评论。

 采纳的回答

Try
imdb.descriptors
Or
imdb.imgList

7 个评论

You don’t have any field named imdb that’s what causing the error
sorry to bother you again,after I follow your method, the program starts running.
% imdb = load('F:\2016_person_re-ID-master\2016_person_re-ID-master\cuhk03-prepare-eval/cuhk03_detected_lomo.mat');
imdb.descriptors
imdb = imdb.imdb;
But the same error eventually occurred.
I think it just load the data in the mat file without actually running the program.
Again you are doing the same mistake
But I've corrected the statement in your way,
% imdb = load('F:\2016_person_re-ID-master\2016_person_re-ID-master\cuhk03-prepare-eval/cuhk03_detected_lomo.mat');
imdb.descriptors
imdb = imdb.imdb;

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by