Errors encountered when implementing the code of “Train Voice Activity Detection in Noise Model Using Deep Learning”
Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you!Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you! Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you! incompatible sizes, tutorial code MATLAB Answers — New Questions