@jvikoren using the legacy optimizer should work in this case, see here: https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/legacy/Optimizer
import tensorflow as tf
from tensorflow.keras.optimizers.legacy import Adam
cifar = tf.keras.datasets.cifar100
(x_train, y_train), (x_test, y_test) = cifar.load_data()
model = tf.keras.applications.ResNet50(
include_top=True,
weights=None,
input_shape=(32, 32, 3),
classes=100,)
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
# Instantiate legacy Adam optimizer
model.compile(optimizer=Adam(), loss=loss_fn, metrics=["accuracy"])
model.fit(x_train, y_train, epochs=5, batch_size=64)
Works for me on M1 Air with a fresh version of miniconda.
Topic:
App & System Services
SubTopic:
Hardware
Tags: