CANNOT make an image prediction after trainning a CNN network
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
After I trained the CNN following the Matlab document, I get a net variable which represents the network. However when I tried to use it to predict new pictures, I read the image which size is 128 by 128 and used net(imgTEST), however it firstly hinted that Array indices must be positive integers or logical values. So I binarized the image and net(imgTEST) again, and then it reported that The logical indices contain a true value outside of the array bounds.
The sizes of pictures I used to train the network are also 128 by 128, so I don't know where goes wrong. Could somebody help? Thank you!
My net's property is given below.
net =
SeriesNetwork with properties:
Layers: [14×1 nnet.cnn.layer.Layer]
InputNames: {'imageinput'}
OutputNames: {'classoutput'}
0 comentarios
Respuestas (1)
Sanjana
el 7 de Jun. de 2023
Hi Jie,
I understand that you are encountering some difficulties with performing predictions on a Test Image with the trained CNN Network.
To perform predictions with a trained CNN Network, which is usually a “dlnetwork” or “DAGNetwork”, you can use “predict” function, with inputs as the network obj and input resized to the size of the network input.
Please refer to the following links, for further information,
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!