0

I'm trying to load a pretrained Keras model into Java app using DL4J. When training in Keras I used "channels_first" image_data_format, and now, in DL4J I can not load my model properly, because it tries to use "channels_last" configuration.

Is there in DL4J any similar function as set_image_data_format("channels_first) in Keras?

Bagoly Sz.
  • 156
  • 7

1 Answers1

1

You can't set such a property, because you simply don't need to. The way Keras model import for DL4J is designed is that you provide your json or h5 file and DL4J will figure out which Keras version you're using, which backend and in particular which data format.

See here for an introduction to the API: https://deeplearning4j.org/model-import-keras

Here's a list of supported features: https://deeplearning4j.org/keras-supported-features

To get you started you might want to look at a few tests, like these model configuration or end to end tests.

If you have any questions, feel free to ping me on gitter. Also, feel free to create an issue if you have one.