how to save/load a deep neural network after transfer learning

조회 수: 3 (최근 30일)
Raphael
Raphael 2018년 11월 21일
댓글: Raphael 2019년 7월 31일
Hi
I have fine-tuned the GoogleNet deep neural network following the example provided in C:\...\Examples\nnet\TransferLearningUsingGoogLeNetExample\TransferLearningUsingGoogLeNetExample.m.
The only change I made is that I used a different ImageStore created by
images = imageDatastore('f:\...\Dstore','IncludeSubfolders',true,'LabelSource','foldernames');
images.ReadFcn = @(loc)imresize(imread(loc),[224,224]);
[trainImages,valImages] = splitEachLabel(images,.7,'randomized');
That ImageStore includes about 1000 images. Once training completed I saved my whole workspace with the command:
save googlenet_mine01
Now I am trying to reuse this network (after exiting and restarting Matlab) but the command
load googlenet_mine01
gives me the following error message:
Error using matlab.io.datastore.ImageDatastore/set.Labels (line 208)
Argument 'numel' must be followed by a nonnegative real scalar integer.
By looking at the stack at the error point I see that imds.Numfiles is empty but I don't understand why?!
Raphael
  댓글 수: 2
Julius Å
Julius Å 2019년 7월 30일
I have this same problem. Did you manage to solve it?
Raphael
Raphael 2019년 7월 31일
Not really. I came to the conclusion that a trained network can be reused only on the machine on which it was created and only if you still have the images that were originally included in the ImageStore still present at the same location

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by