ylecun/mnist
Viewer • Updated • 70k • 91.3k • 280
How to use Josephus67/mnist_model with Keras:
# !pip install -U keras tensorflow huggingface_hub
# Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here;
# "jax" and "torch" also work for computation once TensorFlow is installed.
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras
model = keras.saving.load_model("hf://Josephus67/mnist_model")
This is a Keras/TensorFlow model trained on the MNIST dataset to classify handwritten digits (0-9).
This model is intended for educational purposes to demonstrate digit classification.
You can download and load this model in Python:
from huggingface_hub import hf_hub_download
import tensorflow as tf
# Download the model file
model_path = hf_hub_download(repo_id="your-username/your-model-name", filename="mnist_model.keras")
# Load the model
model = tf.keras.models.load_model(model_path)