transfer learning using Pre-trained vgg-16

How can I train my own CNN using the pre-trained imagenet-vgg-verydeep-16 network. I have tried to use the fully connected layer 'fc7' to train my network and I get the following error.
Undefined function or variable 'activations'. trainingFeatures = activations(convnet, trainingSet, featureLayer, ...
can anybody help please.

回答 (2 件)

mizuki
mizuki 2017 年 8 月 13 日

1 投票

The function "activations" is in Neural Network Toolbox. Do you see NNTB in your license? First check with the following command:
>> ver
Also, the path might not be set correctly. Please follow the below article.

4 件のコメント

Burhan
Burhan 2017 年 8 月 14 日
thank you mizuki
Burhan
Burhan 2017 年 8 月 14 日
Dear Mizuki, if NNTB is meant for Neural Network Toolbox then it was present when I typed >>ver from command line and that is
Neural Network Toolbox Version 10.0 (R2017a)
I also used 'which' function that returned 'activations not found. It however works for Alexnet pre-trained network. I can't figure out, how?
Burhan
Burhan 2017 年 8 月 14 日
sir, one thing more! from Matalab documentation i checked activations function and it exists with same name (and letter case too).
mizuki
mizuki 2017 年 8 月 15 日
NNTB appeared to the output of VER, which means NNTB is installed. I did not get what you have tried exactly. Did you type
>> which -all activations
and resulted in the error message " activations not found"? If so, that is fine since activations is a class, which is not usually searched with doc command.
The situation that AlexNet worked fine but VGG16 does not work sounds that your installation of VGG16 did not work well. How about the result of
>> which -all vgg16
Have you tried the following commands, which is on the page that I mentioned before?
>> restoredefaultpath
>> rehash toolboxcache
>> savepath

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

Burhan
Burhan 2017 年 8 月 15 日

1 投票

1) I typed "ver" and Following line was one of the outputs.
Neural Network Toolbox Version 10.0 (R2017a)
2) I then checked "which -all activations" and the result is: activations not found
3) The result for "which -all vgg16" is: C:\Program Files\MATLAB\R2017a\toolbox\nnet\cnn\vgg16.m
4) Yes, I tried >> restoredefaultpath >> rehash toolboxcache >> savepath
Yet again the following line of my code:
trainingFeatures = activations(convnet, trainSet, featureLayer, ... 'MiniBatchSize', 32, 'OutputAs', 'rows');
produces error: Undefined function or variable 'activations'.

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2017 年 8 月 12 日

回答済み:

2017 年 8 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by