使用的是matlab,代码如下:imds0 = imageDatastore( ... 'gearset\30_2\', ... 'IncludeSubfolders',true, ... 'LabelSource','foldernames'); inputSize = [60 20 3]; augimds0 = augmentedImageDatastore(inputSize(1:2),imds0); % Step 2: 对所有图片进行分类预测 predictedLabels = classify(net, augimds0);
时间: 2024-03-01 20:51:04 浏览: 28
这个错误通常是因为在augmentedImageDatastore对象中没有"Labels"属性而引起的。您可以使用以下代码来检查augmentedImageDatastore对象的属性:
```
properties(augimds0)
```
如果该对象没有"Labels"属性,则可能是因为您在创建augmentedImageDatastore对象时未正确指定标签。您可以尝试在创建augmentedImageDatastore对象时使用以下代码来指定标签来源:
```
augimds0 = augmentedImageDatastore(inputSize(1:2),imds0,'ColorPreprocessing','gray2rgb','DataAugmentation',imageAugmenter,'OutputSizeMode','randcrop','Normalization','rescale-symmetric','MiniBatchSize',200,'Shuffle','every-epoch','InitialLearnRate',0.0001,'LearnRateSchedule','piecewise','LearnRateDropFactor',0.1,'LearnRateDropPeriod',5,'MaxEpochs',50,'Verbose',true,'Plots','training-progress','LabelSource','foldernames');
```
在这个例子中,我们使用"LabelSource"参数将augmentedImageDatastore对象的标签来源设置为文件夹名称。您可以根据您的数据集和代码要求进行相应的更改。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)