Using ResNeXt in Keras 2.2.4

      2 Comments on Using ResNeXt in Keras 2.2.4

To use ResNeXt50, I wrote my code as the API documentation for Keras:

But it reported errors:

That’s weird. The code doesn’t work as documentation said.
So I checked the code of Keras-2.2.4 (the version in my computer), and noticed that this version of code use ‘keras_applications’ instead of ‘keras.applications’.
Then I changed my code:

But it reported another error:

Witout choice, I had to check code of ‘/usr/lib/python3.6/site-packages/keras_applications/resnet_common.py’ too. Finally, I realise the ResNeXt50() function need three more arguments:

Now the program could run ResNeXt50 model correctly. This github issue explained the detail: the ‘keras_applications’ could be used both for Keras and Tensorflow, so it needs to pass library details into model function.

2 thoughts on “Using ResNeXt in Keras 2.2.4

  1. harley

    Can you tell me how did you find add the 3 more arguments,the code works.
    I go to the source code, and didn’t find the 3 arguments,

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.