'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