フィルターのクリア

i am getting error while predicting image??

14 ビュー (過去 30 日間)
Shivam  Kumar
Shivam Kumar 2019 年 10 月 29 日
回答済み: arun anoop m 2020 年 7 月 17 日
img=imread('4.jpg');
>> imshow(img)
>> net=alexnet;
>> predict=classify(net,img)
Error using DAGNetwork/calculatePredict>predictBatch (line 151)
Incorrect input size. The input images must have a size of [227 227 3].
Error in DAGNetwork/calculatePredict (line 17)
Y = predictBatch( ...
Error in DAGNetwork/classify (line 134)
scores = this.calculatePredict( ...
Error in SeriesNetwork/classify (line 502)
[labels, scores] = this.UnderlyingDAGNetwork.classify(X, varargin{:});

採用された回答

Sai Bhargav Avula
Sai Bhargav Avula 2019 年 10 月 29 日
Hi,
The issue might be due input image resolution. alexnet expects an input of size 227*227*3. The image you are passing may not be of the same size. Try resizing the image using imresize function to 227*227*3.
Hope this helps

その他の回答 (1 件)

arun anoop m
arun anoop m 2020 年 7 月 17 日
this helped me to solve errors.
Hope it may help. Nice.

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by