在跑maskrcnn的时候出现以下错误:
Traceback (most recent call last):
File "/home/ubuntu/DNN_Projection/Mask_RCNN--Training/samples/nucleus/nucleus.py", line 483, in
train(model, args.dataset, args.subset)
File "/home/ubuntu/DNN_Projection/Mask_RCNN--Training/samples/nucleus/nucleus.py", line 285, in train
layers='heads')
File "/home/ubuntu/DNN_Projection/Mask_RCNN--Training/mrcnn/model.py", line 2375, in train
use_multiprocessing=True,
File "/home/ubuntu/anaconda3/envs/tensorflow1.3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/tensorflow1.3/lib/python3.6/site-packages/keras/engine/training.py", line 2042, in fit_generator
class_weight=class_weight)
File "/home/ubuntu/anaconda3/envs/tensorflow1.3/lib/python3.6/site-packages/keras/engine/training.py", line 1756, in train_on_batch
check_batch_axis=True)
File "/home/ubuntu/anaconda3/envs/tensorflow1.3/lib/python3.6/site-packages/keras/engine/training.py", line 1378, in _standardize_user_data
exception_prefix='input')
File "/home/ubuntu/anaconda3/envs/tensorflow1.3/lib/python3.6/site-packages/keras/engine/training.py", line 144, in _standardize_input_data
str(array.shape))
ValueError: Error when checking input: expected input_image_meta to have shape (None, 14) but got array with shape (1, 15)
出现该错误是因为我新增了一类,例:
self.add_class("nucleus", 1, "RBC")
self.add_class("nucleus", 2, "ELSE2")
解决办法是修改NUM_CLASSES参数,增加了多少类,就对应的修改对应数值
NUM_CLASSES = 1 + 1