How to declare the weight and bias values for a convolution layer?

3 次查看(过去 30 天)
Greetings,
I want to add a convolution layer in the existing squeezenet network. However the errors shown like this:
Error using assembleNetwork (line 47)
Invalid network.
Error in trainyolov3 (line 80)
newbaseNetwork = assembleNetwork(lgraph); % for tiny-yolov3-coco
Caused by:
Layer 'add_conv': Empty Weights property. Specify a nonempty value for the Weights property.
Layer 'add_conv': Empty Bias property. Specify a nonempty value for the Bias property.
Therefore, I want to ask on how to declare the weights and bias value for that layer? My code is as shown below:
lgraph = disconnectLayers(lgraph,'fire8-concat','fire9-squeeze1x1');
layer = [
maxPooling2dLayer([3 3],"Name","pool6","Padding","same","Stride",[2 2])
convolution2dLayer([1 1],512,"Name","add_conv","Padding",[1 1 1 1],"Stride",[2 2])
reluLayer("Name","relu_add_conv")];
lgraph = addLayers(lgraph, layer);
lgraph = connectLayers(lgraph,'fire8-concat','pool6');
lgraph = connectLayers(lgraph,'relu_add_conv','fire9-squeeze1x1');
newbaseNetwork = assembleNetwork(lgraph);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by