agentsclimarketplace

Keras model conversion to hdf5

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/keras-model-conversion-to-hdf5

Use when you have pre-trained Keras models from the NP-Classifier repository that must be deployed via TensorFlow Serving and need to expose standardized input/output layer names ('input_2048', 'input_4096', 'output') for integration with the classification API.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill keras-model-conversion-to-hdf5

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.9 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

keras-model-conversion-to-hdf5

Summary

Convert pre-trained Keras models to HDF5 TensorFlow 2.3.0 format with properly named input and output layers for deployment in the NP Classifier pipeline. This skill ensures structural compliance of the converted model with the pipeline's layer naming requirements.

When to use

You have pre-trained Keras models from the NP-Classifier repository that must be deployed via TensorFlow Serving and need to expose standardized input/output layer names ('input_2048', 'input_4096', 'output') for integration with the classification API.

When NOT to use

  • The Keras model is already in HDF5 TensorFlow 2.3.0 format with correct layer names.
  • You are deploying the model in a different pipeline that uses different layer naming conventions.
  • TensorFlow version in your environment is not 2.3.0, as the conversion process may produce incompatible artifacts.

Inputs

  • Pre-trained Keras model files (typically .h5 or SavedModel format)
  • get_models.sh script from NP-Classifier/Classifier/models_folder/models
  • TensorFlow 2.3.0 installation with Python environment

Outputs

  • Converted HDF5 TensorFlow 2.3.0 model file
  • Model layer name validation log
  • Model metadata confirming input layer names 'input_2048' and 'input_4096' and output layer name 'output'

How to apply

Clone the mwang87/NP-Classifier repository and navigate to Classifier/models_folder/models. Execute the get_models.sh script, which automates the Keras-to-HDF5 conversion process using TensorFlow 2.3.0. After conversion, load the resulting HDF5 model using TensorFlow's model loading API and inspect the layer architecture to confirm the presence of exactly two input layers named 'input_2048' and 'input_4096' and one output layer named 'output'. Log or persist the layer names as evidence of structural compliance. If layer names do not match the specification, the model will not integrate correctly with downstream API endpoints that expect these specific names.

Related tools

  • TensorFlow 2.3.0 (Performs Keras model conversion to HDF5 format and provides model loading and layer inspection APIs)
  • get_models.sh (Automates download and conversion of pre-trained Keras models to HDF5 TF2 format) — https://github.com/mwang87/NP-Classifier
  • Docker (Provides reproducible environment with pinned TensorFlow 2.3.0 version for model conversion and deployment)
  • Python (Runtime environment required to execute model conversion and validation scripts)

Examples

cd Classifier/models_folder/models && sh ./get_models.sh

Evaluation signals

  • Model loads without error using TensorFlow 2.3.0's model loading API after conversion.
  • Layer inspection confirms exactly two input layers named 'input_2048' and 'input_4096' are present in the model graph.
  • Model output layer is unambiguously named 'output' in the converted HDF5 structure.
  • Model metadata endpoint (/model/metadata) through TensorFlow Serving correctly reports the three required layer names.
  • Downstream /classify API endpoint successfully accepts SMILES input and produces predictions without layer-name mismatch errors.

Limitations

  • Conversion requires TensorFlow 2.3.0 specifically; other versions may produce incompatible HDF5 artifacts or altered layer names.
  • If upstream Keras models do not conform to the expected input/output structure, conversion will succeed but layer names will not match the pipeline specification, causing downstream API failures.
  • The conversion process is one-way; reverting from HDF5 TF2 format back to native Keras format may result in loss of metadata.

Evidence

  • [readme] Make sure you have python installed and tensorflow version 2.3.0 installed to convert the keras models into HDF5 TF2 models.: "Make sure you have python installed and tensorflow version 2.3.0 installed to convert the keras models into HDF5 TF2 models"
  • [readme] Input layers' names should be "input_2048" and "input_4096". Output layer's name should be "output": "Input layers' names should be "input_2048" and "input_4096"

Output layer's name should be "output""

  • [readme] cd Classifier/models_folder/models; sh ./get_models.sh: "cd Classifier/models_folder/models sh ./get_models.sh"
  • [other] The NP Classifier model conversion process requires the resulting HDF5 TF2 model to expose three specific layer names: two input layers named 'input_2048' and 'input_4096', and one output layer named 'output'.: "The NP Classifier model conversion process requires the resulting HDF5 TF2 model to expose three specific layer names: two input layers named 'input_2048' and 'input_4096', and one output layer named"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,782. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.