Learn R Programming

imageseg (version 0.5.0)

loadModel: Load TensorFlow model from hdf5 file

Description

Load TensorFlow model from hdf5 file

Usage

loadModel(modelFile, restoreCustomObjects = TRUE)

Arguments

modelFile

character. File name of the .hdf5 model file to load

restoreCustomObjects

logical. Restore custom objects (loss function & dice coefficient) used in training of habitat models

Value

keras model

Details

Loads a trained TensorFlow model from a hdf5 file, and (optionally) restores custom objects.

Examples

Run this code
# NOT RUN {
# Canopy model
wd_model_can <- "C:/Path/To/Model"      # change this
filename_model_can <- "imageseg_canopy_model.hdf5"
model_can <- loadModel(file.path(wd_model_can, filename_model_can))

# Understory model
# note, here we just specify the complete path, not separate by directory and file name as above
model_file_us <- "C:/Path/To/Model/imageseg_understory_model.hdf5"
model_us <- loadModel(model_file_us)
# }

Run the code above in your browser using DataLab