필터 지우기
필터 지우기

Where is the problem with this code?

조회 수: 2 (최근 30일)
lech king
lech king 2021년 4월 15일
답변: Cris LaPierre 2021년 4월 15일
I will receive this message after entering the information(dsnew) into the deep learning application
invalid training data for classification network response must be categorical
location1 = fullfile(matlabroot,'bin','F18','test9','noise');
location2 = fullfile(matlabroot,'bin','F18','test9','1','main');
location3 = fullfile(matlabroot,'bin','F18','test9','1','validation');
noise = imageDatastore({location1},'FileExtensions',{'.jpg','.png','.jpeg'},'IncludeSubfolders',true,'LabelSource','foldernames');
nonnoise = imageDatastore({location2},'FileExtensions',{'.jpg','.png','.jpeg'},'IncludeSubfolders',true,'LabelSource','foldernames');
validation = imageDatastore({location3},'FileExtensions',{'.jpg','.png','.jpeg'},'IncludeSubfolders',true,'LabelSource','foldernames');
aug1 = imageDataAugmenter('RandRotation',[0 90],'RandScale',[1.1 1.3]);
auimds1 = augmentedImageDatastore([224 224 1],nonnoise,'ColorPreprocessing','rgb2gray','DataAugmentation',aug1);
auimds2 = augmentedImageDatastore([224 224 1],noise,'ColorPreprocessing','rgb2gray');
validation1 = augmentedImageDatastore([224 224 1],validation,'ColorPreprocessing','rgb2gray');
dsnew = combine(noise,nonnoise);
  댓글 수: 2
Jan
Jan 2021년 4월 15일
It is a bad idea to store data in Matlab bin directory.
Please post the complete error message. This is better than letting the readers guess, which lines causes the problem.
lech king
lech king 2021년 4월 15일
It is true that my explanations were not enough
I'm sorry
The code executes correctly
I have merged 2 training data, one with noise and the other without noise, in the last line and saved in the dsnew variable
The deep learning app show this message when running

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 4월 15일
Inspect your response variable. It apparently has the wrong data type.
If you don't yet know how to create categorical data, see this link.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by