在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1. 首先,你要又并行计算的工具箱,在插件选项里面找到,安装即可 2. 下载训练的数据集,采用matlab演示的材料即可 https://matlabacademy-content.mathworks.com/3.3/R2017b/content/deeplearning_course_files.zip 3. 运行训练脚本: The code below implements transfer learning for the flower species example in this chapter. It is available as the script
trainflowers.mlx in the course example files. You can download the course example files from the help menu in the top-right corner. Note that this example can take some time to run if you run it on a computer that does not have a GPU.Get training imagesflower_ds = imageDatastore('Flowers','IncludeSubfolders',true,'LabelSource','foldernames'); [trainImgs,testImgs] = splitEachLabel(flower_ds,0.6); numClasses = numel(categories(flower_ds.Labels));
Create a network by modifying AlexNetnet = alexnet; layers = net.Layers; layers(end-2) = fullyConnectedLayer(numClasses); layers(end) = classificationLayer;
Set training algorithm optionsoptions = trainingOptions('sgdm','InitialLearnRate', 0.001);
Perform training[flowernet,info] = trainNetwork(trainImgs, layers, options);
Use trained network to classify test imagestestpreds = classify(flowernet,testImgs); 4. 运行报错,GPU内存不够 设置小一点:options = trainingOptions('sgdm','InitialLearnRate', 0.001,'MiniBatchSize', 64); options = SequencePaddingValue: 0 5. 结果 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论