Hi Hugging Face team,
I encountered an issue while trying to use the ELIXR-C-v2-pooled model from the Google CXR Foundation hosted on Hugging Face (google/cxr-foundation
).
Problem Description
According to the documentation and example notebooks (from Hugging Face and Google), the TensorFlow SavedModel should include a serving_default
signature for inference. However, after downloading the model using huggingface_hub.snapshot_download
, the TensorFlow SavedModel does not contain any predefined signatures.
–_
Steps to Reproduce
- Download the model using the provided repository and the
huggingface_hub
library:
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="google/cxr-foundation",
local_dir="./saved_model",
allow_patterns=["elixr-c-v2-pooled/**"]
)
- Load the model in TensorFlow and check its signatures:
import tensorflow as tf
model_path = "./saved_model/elixr-c-v2-pooled"
model = tf.saved_model.load(model_path)
print("Available model signatures:", model.signatures)
print("Keys:", model.signatures.keys())
- Output shows no available signatures:
Available model signatures: _SignatureMap({})
KeysView(_SignatureMap({}))
Expected Behavior
The model should include the serving_default
signature, allowing inference as shown in the official example notebooks.
Actual Behavior
The model does not have any predefined signatures, making it impossible to invoke for inference using the example code.
System Details
- Environment: Lightning.ai with NVIDIA L4 GPU
- TensorFlow Version: 2.18.0
- CUDA Version: 12.2
- Python Version: 3.10
- Hugging Face Library Version: Latest (
pip install huggingface_hub
)
Proposed Solution
If the missing signature is due to an incomplete export or versioning issue:
- Re-export the model with proper signature definitions (
serving_default
). - Update the hosted model to include this signature.
Alternatively, if the serving_default
signature is deprecated for this model version:
- Provide documentation on how to use the model without predefined signatures.
- Include examples showing the correct methods or attributes to use for inference.
Additional Notes
- I followed the official instructions in the Hugging Face documentation for Google CXR Foundation and tested with both manual downloads and automated pipelines.
- The missing signature prevents inference as described in the example notebooks.
- I am happy to test any suggestions or updated versions of the model.
Thank you for your help! Please let me know if additional details are needed.