필터 지우기
필터 지우기

how to resolve this input size error

조회 수: 10 (최근 30일)
Aiman Zara
Aiman Zara 2023년 3월 15일
댓글: Image Analyst 2023년 3월 16일
i am having trouble to resolve this input size error, tried putting (224 224) the input size as my pretrained model is googlenet, tried putting 22 which is the no of folders in my dataset, that I have trained my model on
pretrained = load("D:\Training\T6\netTransfer.mat");
classes = pretrained;
cam = webcam;
player = vision.VideoPlayer;
classifyInterval = 10;
sequenceLength = pretrained.InputSize(22);
maxNumFrames = 280;
numFrames = 0;
text = "";
while numFrames <= maxNumFrames
frame = snapshot(cam);
numFrames = numFrames + 1;
pretrained = updateSequence(pretrained,frame);
if mod(numFrames, classifyInterval) == 0 && numFrames >= sequenceLength
[label,scores] = classifySequence(pretrained);
if ~isempty(label)
text = string(label) + "; " + num2str(max(scores), "%0.2f");
end
end
frame = insertText(frame,[30,30],text,'FontSize',18);
step(player,frame);
end
but it didnot work, I don't get now what it is asking for. Please suggest me ways to resolve this.

답변 (1개)

Image Analyst
Image Analyst 2023년 3월 15일
You forgot to attach "D:\Training\T6\netTransfer.mat". Pretrained is a structure that contains all the variables you saved as fields of that structure. Evidently there is no InputSize field of the pretrained structure, hence it throws that error. When you call save(), make sure you also tell it to save the InputSize variable.
  댓글 수: 2
Aiman Zara
Aiman Zara 2023년 3월 16일
@Image Analyst it throws the same error, even after loading the pretrained file. I dont get your point of input size which you discussed above. Please elaborate it for me or provide some solutions to get through this problem. waiting
Image Analyst
Image Analyst 2023년 3월 16일
When you get the error, open up classes or pretrained by double clicking on them in the Workspace panel. What do you see? Do you see a InputSize field on those structures? (The answer is No.) So how can you use if if it's not there?

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by