필터 지우기
필터 지우기

Question about errors that occur when exporting models with residualBlockLayer to Tensorflow.

조회 수: 4 (최근 30일)
I get an error
’nnet.internal.cnn.tf_exporter.ConverterForUnsupportedLayer/verifyNumericLearnablesAndState (行 171)
Layer 'layer': This network has nonnumeric Learnable or State parameters and cannot be exported.'
when I run the following code.
where residentialBlockLayer is a custom layer defined in the bottom layer code of
Should I change the way I define custom layers?
We would appreciate it if you could include the method of change definition.
nt = 10;
ns = 10;
numFilters = 10;
layers = [
imageInputLayer([nt ns 1],'Normalization','none')
convolution2dLayer(3,numFilters,'Padding','same')
residualBlockLayer(numFilters)
convolution2dLayer(3,2,'Padding','same')
];
net = dlnetwork(layers);
exportNetworkToTensorFlow(net,"myModel")

답변 (1개)

Poorna
Poorna 2024년 6월 2일
Hi Yoshinobu,
I see you are facing errors while trying to export a custom network to TensorFlow using the "exportNetworkToTensorFlow" function. I was able to reproduce the error. The error says that the network has nonnumeric learnable parameters. This is caused by the custom network "residualBlockLayer" having "Network" as a learnable/state propery which is causing the export function to categorize it as nonnumeric. If you examine the code, then you would see that the "Network" property holds the dlnetwork object of the custom network itself.
Now, instead of using the "residualBlockLayer" function to include the custom layer, you can look at the code and see what layers are defined inside the network and directly use those layers to create your desired network.
Also, you need to connect the second input of the addition layer manually just like how it is done in the "residualBlockLayer" class when "IncludeSkipConvolution" is set to true.
Refer to the following documentation to know more about "additionLayer"
Hope this Helps!

카테고리

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

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by