i am getting error while predicting image??
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
 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{:});
댓글 수: 0
채택된 답변
  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
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


