I have been working with neural networks in Deeplearning4j and needed to switch it to Python. To use the same model (MultiLayerNetwork in DL4J) I saved it as a .h5 file. Like this:
File newFile = new File("newModel.h5");
ModelSerializer.writeModel(network, newFile, true);
Now, when i try to load it in Python I get the following error:
OSError: SavedModel file does not exist at: newModel.h5/{saved_model.pbtxt|saved_model.pb}
I have tried to use different extensions like .pb and used relative and absolute paths in python. Nothing helped. Can anyone explain to me why this happens? There seems to be not enough information on this issue on the internet and it seems to be the only way to implement the same code in python is to train a new model, etc.