bethgelab / siamese-mask-rcnn

Siamese Mask R-CNN model for one-shot instance segmentation
Other
346 stars 60 forks source link

Dimension dismatch error when evaluate the retrained model for COCO, from epoch 2 #27

Closed li-yanling closed 4 years ago

li-yanling commented 4 years ago

Hi,

I trained COCO from your pretrained ImageNet weight, then use the trained COCO model to evaluate. It works fine with the first epoch model, however, start from the second epoch model, it show error in model = siamese_model.SiameseMaskRCNN(mode="inference", model_dir=MODEL_DIR, config=config) model.load_checkpoint(checkpoint, training_schedule=train_schedule) that: Dimension 0 in both shapes must be equal, but are 1 and 7. Shapes are [1,1,512,256] and [7,7,3,64]. for 'Assign_394' (op: 'Assign') with input shapes: [1,1,512,256], [7,7,3,64].

If we note the epoch 1 and 2 model as 'siamese_mrcnn_0001.h5‘ and 'siamese_mrcnn_0002.h5', I checked the shape of the h5py dataset of both models, they are exact same. May I get some suggestion about this error? Thanks

michaelisc commented 4 years ago

I have to say that I have no idea what causes this error. The shapes look the same and you checked the shapes of the models saved in the .h5 files. Have you checked for any other potential causes of errors (cached variables etc.)?

li-yanling commented 4 years ago

I have to say that I have no idea what causes this error. The shapes look the same and you checked the shapes of the models saved in the .h5 files. Have you checked for any other potential causes of errors (cached variables etc.)?

One thing is also not right. I renamed your pretrained 'small_siamese_mrcnn_0160.h5' as 'siamese_mrcnn_0001.h5' so that I can continue to train your pretrained model. But I cannot continue because it shows "Shapes must be equal rank, but are 1 and 4 for 'Assign_4' (op: 'Assign') with input shapes: [64], [1,1,64,64]." Some online comments said mismatch is because of keras but my keras is 2.1.6. What is your h5py and tensorflow version? I think maybe my environment is not right?