keras_compact_bilnear_CNN icon indicating copy to clipboard operation
keras_compact_bilnear_CNN copied to clipboard

Keras Version

Open nattari opened this issue 5 years ago • 3 comments

Thanks, Aniket for sharing the code. While using your implementation, I get an error at the following line in vgg_cbcnn.py: x = merge(compact_bilinear_arg_list, mode=compact_bilinear, name='compact_bilinear', output_shape=output_shape_cb). It gives a Typeerror (module object is not callable). By doing some search, I found that the new version of Keras has replaced merge with concatenate, but this did not help either. Do you have any insights?

nattari avatar Jun 19 '19 10:06 nattari

Screenshot 2019-06-19 at 18 24 17 On trying the implementation on a linux machine, I do not get version related error but I get another error. Please find attached the screenshot for the same.

nattari avatar Jun 19 '19 16:06 nattari

Hi @nattari Sorry for a late reply

  1. Regarding point (1), yes layer merge has been replaced with concatenate and due to that you might be facing the error. For record I used the version Keras==2.1.4 while training the model, which allows the usage of merge layer.

  2. For point 2, I am not too sure, why you got this error. I guess you are using a batch size of 64, and have 200 classes in your dataset. Could you pls check what is the shape of labels array that is being returned by train_generator or val_generator. Also if required (which IMO should not) you could try changing this line here to ensure that the target labels numpy array has the correct shape as required.

aniket03 avatar Jun 30 '19 08:06 aniket03

I meet the same issue,when i using Lambda replaced merge ,the code can run.

liuqiang3 avatar Jan 06 '20 14:01 liuqiang3