loading and training an existing network.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mark Hubelbank
el 7 de Oct. de 2024
I am trying define a network, then train it in multiple sessions. The problem is that I can't get the load or read of the network to work in the second session. The code is:
layers = [ ...
sequenceInputLayer(270)
bilstmLayer(numHiddenUnits,OutputMode="last")
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer]
options = trainingOptions("adam", ...
InitialLearnRate=0.002,...
MaxEpochs=15, ...
Shuffle="never", ...
GradientThreshold=1, ...
Verbose=false, ...
ExecutionEnvironment="gpu", ...
Plots="training-progress");
clabels=categorical(labels);
numLables=numel(clabels)
load("savednet.mat","layers");
net = trainNetwork(data,clabels,layers,options);
save("savednet","net");
I have tried many variations of the load command and it always gives an error on the second argument:
Warning: Variable 'layers' not found.
Exactly what should that look like and then how should it be used as input to the trainNetwork routine?
7 comentarios
Mark Hubelbank
el 7 de Oct. de 2024
Movida: Walter Roberson
el 7 de Oct. de 2024
Walter Roberson
el 7 de Oct. de 2024
Probably
net1 = trainnet(data,clabels,net1,"crossentropy",options);
Respuesta aceptada
Matt J
el 7 de Oct. de 2024
previous = load("savednet","net","layers");
net = trainNetwork(data,clabels,previous.net,options);
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!