Loading and using pretrained networks

조회 수: 8 (최근 30일)
Chris Underwood
Chris Underwood 2020년 11월 9일
답변: Chris Underwood 2020년 11월 17일
I'm working with sets of 8 neural networks and when I load them all and try to use them Matlab doesn't recognise them.
  댓글 수: 1
Raunak Gupta
Raunak Gupta 2020년 11월 12일
Hi,
Can you provide the specific code you are using and the error message displayed in the Command Window. This will help in understanding the issue.

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

채택된 답변

Raunak Gupta
Raunak Gupta 2020년 11월 17일
Hi,
From the example mentioned in the follow up, I think the trained network are not saved properly. Let say you have four trained networks in the workspace naming net1, net2, net3, net4. Then to save them in a single matrix you can use
save('networks.mat','net1','net2','net3','net4');
Afterwards if you want to load the networks into the workspace following command can be useful
load networks.mat
This will load all networks separately into the workspace.

추가 답변 (2개)

Chris Underwood
Chris Underwood 2020년 11월 16일
There's no specific code Raunak. I trained a set of ANNs using the Deep Learning Toolbox and, one each was trained, I saved it using the 'save' command. Later, when I went on to use the trained networks I used the 'load' command at the Matlab prompt. When I tried to use the 'loaded' network I got 'Unrecognised variable or function'. Is it because I am trying to load several networks at once (8 in all)? I've managed to get round it by re-training the networks after issuing 'cleavars' and then applying them whilst they are still in memory (i.e. not specifically saving them). This works OK but this takes a long time!

Chris Underwood
Chris Underwood 2020년 11월 17일
Ah right. I hadn't realised that they needed to be saved as a linked set like that. I'll try that. Many thanks for your help Raunak.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by