필터 지우기
필터 지우기

CANNOT make an image prediction after trainning a CNN network

조회 수: 3 (최근 30일)
Jie
Jie 2022년 11월 10일
답변: Sanjana 2023년 6월 7일
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'}

답변 (1개)

Sanjana
Sanjana 2023년 6월 7일
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!

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by