-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathdemo_train.m
39 lines (29 loc) · 1.14 KB
/
demo_train.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% =========================================================================
%
% Author: Ignacio Rocco
%
% This script demonstrates the training procedure described in cnngeometric
% Refer to README.md for setup instructions, and to our project page for
% additional information: http://www.di.ens.fr/willow/research/cnngeometric/
%
% =========================================================================
%% ======================== Setup environment and download training dataset
% setup paths
setup;
% define path to training dataset
paths.trValdatasetPath = fullfile(paths.baseDir,'datasets','pascal-voc11');
% download the Pascal-VOC 2011 for training if not there
if isempty(dir(paths.trValdatasetPath))
downloadPascal2011dataset ;
end
% download pretrained VGG-16 model
if isempty(dir(fullfile(paths.baseDir,'training','imagenet-vgg-verydeep-16.mat')))
downloadPretrainedVGG16 ;
end
%% ================================================== Load training options
% load CNN training options (topts)
load(fullfile(paths.baseDir,'training','training_options','aff_pascal','topts.mat'));
% use GPU?
topts.gpus=1;
% train
trainNetwork(paths,topts);