Error using trainNetwork (line 170)
Show older comments
when I trained a vgg16(), I typed 「[net, info] = trainNetwork(datasource,lgraph,options);」.
And i got an error 「Error using trainNetwork (line 170)
The height and width of an image and its corresponding pixel labeled image must be equal if DataAugmentation is specified or if OutputSizeMode
is 'randcrop' or 'centercrop'.」.
Does anyone know how to fix it?
Answers (1)
Cris LaPierre
on 3 Jan 2021
0 votes
It would appear you have images and pixel labeled images in your image datastore datasource. These images do not have the same size.
To fix this error, you must either ensure the images and their pixel labeled equivalent have the same height and width, or you must set your options so that DataAugmentation is not specified, and OutputSizeMode is not 'randcrop' or 'centercrop'.
Categories
Find more on Semantic Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!