keras_compact_bilnear_CNN
keras_compact_bilnear_CNN copied to clipboard
Keras Version
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?
![Screenshot 2019-06-19 at 18 24 17](https://user-images.githubusercontent.com/7510353/59783122-b8e5fd80-92bf-11e9-808d-8e9c47349f34.png)
Hi @nattari Sorry for a late reply
-
Regarding point (1), yes layer
merge
has been replaced withconcatenate
and due to that you might be facing the error. For record I used the versionKeras==2.1.4
while training the model, which allows the usage ofmerge
layer. -
For point 2, I am not too sure, why you got this error. I guess you are using a
batch size of 64
, and have200 classes
in your dataset. Could you pls check what is the shape of labels array that is being returned bytrain_generator
orval_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.
I meet the same issue,when i using Lambda replaced merge ,the code can run.