January 2019
Intermediate to advanced
322 pages
7h 29m
English
In Chapter 10, Deploying on a Distributed System, Importing Python Models in the JVM with DL4J section, we learned how to import existing Keras models into DL4J and use them to make predictions or re-train them in a JVM-based environment.
This applies to the model we implemented and trained in the Hand-on NLP with Keras and TensorFlow backend section in Python, using Keras with a TensorFlow backed. We need to modify the code for that example to serialize the model in HDF5 format by doing the following:
model.save('sa_rnn.h5')
The sa_rnn.h5 file produced needs to be copied into the resource folder for the Scala project to be implemented. The dependencies for the project are the DataVec API, ...
Read now
Unlock full access