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 件のコメント

madhan ravi
madhan ravi 2018 年 10 月 27 日
file?
mengqiu ren
mengqiu ren 2018 年 10 月 27 日
What's file? The file about LOMO feature extraction ?
Image Analyst
Image Analyst 2018 年 10 月 27 日
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.
mengqiu ren
mengqiu ren 2018 年 10 月 28 日
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

サインインしてコメントする。

 採用された回答

madhan ravi
madhan ravi 2018 年 10 月 28 日

0 投票

Try
imdb.descriptors
Or
imdb.imgList

7 件のコメント

madhan ravi
madhan ravi 2018 年 10 月 28 日
You don’t have any field named imdb that’s what causing the error
mengqiu ren
mengqiu ren 2018 年 10 月 28 日
It works!Thank you !
madhan ravi
madhan ravi 2018 年 10 月 28 日
Anytime :)
mengqiu ren
mengqiu ren 2018 年 10 月 28 日
編集済み: mengqiu ren 2018 年 10 月 28 日
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.
madhan ravi
madhan ravi 2018 年 10 月 28 日
Again you are doing the same mistake
mengqiu ren
mengqiu ren 2018 年 10 月 28 日
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;
madhan ravi
madhan ravi 2018 年 10 月 28 日
imdb=imdb.descriptors

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2018 年 10 月 27 日

コメント済み:

2018 年 10 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by