How to increase network input size for 'Tiny-yolov3-coco'?
5 ビュー (過去 30 日間)
古いコメントを表示
Greetings,
I want to use 'tiny-yolov3-coco' for detecting the cells. As shown in the Figure, I used a network input size of 416x416. However, the total loss is still high. Therefore I want to increase the network input size to 832x832. The code that I used as follows:
networkInputSize = [832 832 3];
baseNetwork = 'tiny-yolov3-coco';
detector = yolov3ObjectDetector(baseNetwork);
net = detector.Network;
lgraph = layerGraph(net);
imgLayer = imageInputLayer(networkInputSize,"Name","input","Normalization","none");
lgraph = replaceLayer(lgraph,"input",imgLayer);
newbaseNetwork = assembleNetwork(lgraph);
However, I got the error as follows:
Error in trainyolov3 (line 61)
newbaseNetwork = assembleNetwork(lgraph);
Caused by:
Network: Missing output layer. The network must have at least one output layer.
Layer 'conv2d_10': Unconnected output. Each layer output must be connected to the input of another layer.
Layer 'conv2d_13': Unconnected output. Each layer output must be connected to the input of another layer.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1172948/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1172948/image.png)
0 件のコメント
採用された回答
Khushboo
2022 年 10 月 31 日
Hello,
The network that you are using is a dlnetwork (which does not have output layers) and not a DAG network. The assembleNetwork function returns a DAG network ready for prediction. If using a dlnetwork works for your usecase, you can do the following:
networkInputSize = [832 832 3];
baseNetwork = 'tiny-yolov3-coco';
detector = yolov3ObjectDetector(baseNetwork);
net = detector.Network;
lgraph = layerGraph(net);
imgLayer = imageInputLayer(networkInputSize,"Name","input","Normalization","none");
lgraph = replaceLayer(lgraph,"input",imgLayer);
newbaseNetwork = dlnetwork(lgraph);
Hope this answers your question!
2 件のコメント
Khushboo
2022 年 10 月 31 日
Hello,
I am not able to understand what this code does. But from what I assume, the error is related to the number of dimensions defined for the last convolution layer. As you are changing the input size, I think the rest of the dimensions will have to be changes correspondingly. Kindly make sure you have done that.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!