Activations Error - Struct contents reference from a non-struct array object.

조회 수: 11 (최근 30일)
Teg
Teg 2018년 8월 25일
편집: Matt J 2018년 8월 25일
I'm trying to work with a neural network...which works fine with the newest version of MatLab. However, when I run the same code on an older version of MatLab, I get the error as below. The reason why I need the older version of MatLab is because for trivial reasons, my Uni Mechatronics Labs don't have the latest MatLab version....and for testing I need my code to run on them. My Uni as far as I know runs 2017b MatLab version. At home I am also running 2018a MatLab version.
In my neural network, in the activations lines you might see the variable _ rgbImage_. When I trained the neural network, I used an augimagedatastore instead of an rgbImage file (M by N by 3). So when I run the line with an rgbImage variable in MatLab 2017a, it gives the error below...however, in 2018a, the error doesn't exist and my neural network runs well. Any tips on how I could get my code to run on MatLab 2017a as well?
Struct contents reference from a non-struct array object.
Error in nnet.internal.cnn.layer.Layer>@(x)x.Name (line 161)
layerNames = cellfun(@(x)x.Name, layers, 'UniformOutput', false);
Error in nnet.internal.cnn.layer.Layer.getLayerNames (line 161)
layerNames = cellfun(@(x)x.Name, layers, 'UniformOutput', false);
Error in nnet.internal.cnn.layer.Layer.findLayerByName (line 156)
layerNames = nnet.internal.cnn.layer.Layer.getLayerNames(layers);
Error in nnet.internal.cnn.util.validateNetworkLayerNameOrIndex (line 11)
[layerIndex, layerNames] = nnet.internal.cnn.layer.Layer.findLayerByName(internalLayers, name);
Error in SeriesNetwork/activations (line 747)
layerID = nnet.internal.cnn.util.validateNetworkLayerNameOrIndex(layerID, internalLayers, 'activations');
Error in Segmentation (line 228)
testColourFeatures = activations(networkName,rgbImage,layer,'OutputAs', 'rows');

채택된 답변

Matt J
Matt J 2018년 8월 25일
편집: Matt J 2018년 8월 25일
According to the documentation, the augmentedImageDatastore object was introduced in R2018a. So, it makes sense that R2017 won't recognize it. Can you use an older object type?

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by