How to increase network input size for 'Tiny-yolov3-coco'?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fahmi Akmal Dzulkifli
el 29 de Oct. de 2022
Comentada: Khushboo
el 31 de Oct. de 2022
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.
0 comentarios
Respuesta aceptada
Khushboo
el 31 de Oct. de 2022
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 comentarios
Khushboo
el 31 de Oct. de 2022
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!