Generating equal keras models with th desired data format
Project description
Keras data format converter
Generating equal keras models with the desired data format
Requirements
tensorflow >= 2.0
API
convert_channels_first_to_last(model: keras.Model, inputs_to_transpose: List[str] = None, verbose: bool = False) -> keras.Model
convert_channels_last_to_first(model: tf.keras.Model, inputs_to_transpose: List[str] = None, verbose: bool = False) \ -> tf.keras.Model
model
: Keras model to convert
inputs_to_transpose
: list of input names that need to be transposed due tothe data foramt changing
verbose
: detailed output
Getting started
from tensorflow import keras
from keras_data_format_converter import convert_channels_last_to_first
# Load Keras model
keras_model = keras.models.load_model("my_image_model")
# Call the converter (image_input is an input that needs to be transposed, can be different for your model)
converted_model = convert_channels_last_to_first(keras_model, ["image_input"])
License
This software is covered by MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for keras-data-format-converter-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85cad32381feed3eec04ee1319df94632d6ac54d56c2c6a8d7e43d3d8abc565 |
|
MD5 | 82726a1541b84b1ab9c1a6be1ebdd9df |
|
BLAKE2b-256 | a9042bac32d75e97f879377b247ba7625be1cb700bbcabd248cea78a21e93de1 |