'Number of channels in input image must be 3' error when trying to train in YOLO v2

5 次查看(过去 30 天)
I am trying to apply YOLO v2 in my dataset to train images (greyscale x-ray images). After first epoch it is giving the following error.
Bounding boxes must be fully contained within their associated image and must have positive width and height.
Training on single CPU.
|========================================================================================|
| Epoch | Iteration | Time Elapsed | Mini-batch | Mini-batch | Base Learning |
| | | (hh:mm:ss) | RMSE | Loss | Rate |
|========================================================================================|
| 1 | 1 | 00:04:49 | 42.32 | 1791.2 | 0.0010 |
Error using vision.internal.cnn.yolo.yolov2Datastore>iYOLOv2ChannelAugmentation (line 238)
Number of channels in input image must be 3.
Error in vision.internal.cnn.yolo.yolov2Datastore/readByIndex (line 123)
img = iYOLOv2ChannelAugmentation(img,ds.DatastoreOutSize(1,3));
Error in vision.internal.cnn.yolo.yolov2Datastore/read (line 156)
[data,info] = readByIndex(ds,indices);
Error in nnet.internal.cnn.MultiInputMultiOutputMiniBatchDatastoreDispatcher/next (line 179)
this.Datastore.read());
Error in nnet.internal.cnn.Trainer/train (line 108)
[X, response] = data.next();
Error in vision.internal.cnn.trainNetwork (line 48)
trainedNet = trainer.train(trainedNet, trainingDispatcher);
Error in trainYOLOv2ObjectDetector>iTrainYOLOv2 (line 363)
ds, lgraph, opts, executionSettings, mapping, checkpointSaver, ...
Error in trainYOLOv2ObjectDetector (line 145)
[net, info] = iTrainYOLOv2(ds, lgraph, trainingData, params, mapping, options, checkpointSaver);
Error in trainYOLO (line 65)
[detector,info] = trainYOLOv2ObjectDetector(teethDataset,lgraph,options);

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-5-22
编辑:KALYAN ACHARJYA 2019-5-22
I am gussing from thr error-
'Number of channels in input image must be 3' &
"I am trying to apply YOLO v2 in my dataset to train images (greyscale x-ray images)."
The model may accept RGB images/colors, which have 3 channels

更多回答(1 个)

ping.jiang
ping.jiang 2019-6-13
捕获.PNG 将最后一个卷积层改为3.

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by