<jupyter_start><jupyter_text>Convert Keras Model to Estimator<jupyter_code>cifar_est = tf.keras.estimator.model_to_estimator(keras_model=model)
model.summary()

import numpy as np
input_fn = tf.estimator.inputs.numpy_input_fn(
    x={model.input_names[0]: x_train},
    y=y_train,
    batch_size=batch_size,
    num_epochs=None,
    shuffle=True
)

eval_fun = tf.estimator.inputs.numpy_input_fn(
    x={model.input_names[0]: x_test},
    y=y_test,
    num_epochs=None,
    shuffle=True
)

cifar_est.train(input_fn=input_fn, steps=epochs)
res = cifar_est.evaluate(input_fn=input_fn,steps=1)
# model.input_names

x_train.shape

print(res)<jupyter_output>INFO:tensorflow:Calling model_fn.
{'fraction_non_alphanumeric': 0.11532846715328467, 'fraction_numerical': 0.004379562043795621, 'mean_word_length': 5.929292929292929, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '253686', 'license': 'Apache-2.0', 'n_tokens_mistral': 292, 'n_tokens_neox': 290, 'n_words': 34, 'path': 'Image/Test/CIFAR_100.ipynb', 'repo_name': 'HardikSuthar3/DeepLearningTutorials', 'size': '685'}