get_keras_model {autovi} | R Documentation |
Download and load the keras model
Description
This functions download the keras model from the TengMCing/autovi_data
Github repo using download.file()
and load the model.
Usage
get_keras_model(model_name, format = "npz")
Arguments
model_name |
String. The model name. See also |
format |
String. The model format to download. Either "npz", "SavedModel" or "keras". |
Details
Note that the "SavedModel" and "keras" formats are not supported in
tensorflow
versions above 2.15, as
reticulate::import("tensorflow")$keras$models$load_model
encounters issues
when loading models saved with the Keras 2 API.
Instead, using the "npz" format allows for rebuilding the model
from scratch and loading the weights from a ".npz" file, offering a more
reliable alternative.
Value
A keras model.
Examples
keras_model <- try(get_keras_model("vss_phn_32"))
if (!inherits(keras_model, "try-error")) keras_model$summary()
[Package autovi version 0.4.1 Index]