microsoft/cats_vs_dogs
Viewer โข Updated โข 23.4k โข 7.02k โข 80
How to use RahmahwithCode/cats-vs-dogs-cnn 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://RahmahwithCode/cats-vs-dogs-cnn")
A small convolutional neural network (Keras) that classifies photos as cat or dog.
from tensorflow import keras
model = keras.models.load_model("cats_vs_dogs_cnn.keras")