-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoGraph could not transform <bound method TopLevelFeature.decode_example of FeaturesDict #35101
Comments
prints:
Does RC1 fix the issue? |
Tensorflow at Arch Linux upgraded to new version
but same warnings are displayed:
|
I guess this issue is related to using Tensorflow with Python-3.8. |
The error vanishes if I downgraded my system to:
After system upgrade (Python 3.8.0) I get the error messages again:
Seams that this is an issue of Python-3.8.0 and Tensorflow-2.1.0-rc1. |
@olk Try building tensorflow nightly version with python 3.8 and let me know if the issue still persists. Thanks! |
It has been 14 days with no activity and the |
I'm too busy to build tensorflow from scratch ... |
System information
Describe the current behavior
executing Tensorflow's MNIST handwriting example produces warning:
Code to reproduce the issue
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow.keras.optimizers import Adam
def build_model():
filters = 48
units = 24
kernel_size = 7
learning_rate = 1e-4
model = tf.keras.Sequential([
tf.keras.layers.Conv2D(filters=filters, kernel_size=(kernel_size, kernel_size), activation='relu', input_shape=(28, 28, 1)),
tf.keras.layers.MaxPooling2D(),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(units, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
model.compile(loss='sparse_categorical_crossentropy', optimizer=Adam(learning_rate), metrics=['accuracy'])
return model
datasets, info = tfds.load(name='mnist', with_info=True, as_supervised=True)
mnist_train, mnist_test = datasets['train'], datasets['test']
num_train_examples = info.splits['train'].num_examples
num_test_examples = info.splits['test'].num_examples
BUFFER_SIZE = 10000
BATCH_SIZE = 32
def scale(image, label):
image = tf.cast(image, tf.float32)
image /= 255
return image, label
train_dataset = mnist_train.map(scale).shuffle(BUFFER_SIZE).repeat().batch(BATCH_SIZE).prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
eval_dataset = mnist_test.map(scale).repeat().batch(BATCH_SIZE).prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
model = build_model()
epochs=2
model.fit(
train_dataset,
validation_data=eval_dataset,
steps_per_epoch=num_train_examples/epochs,
validation_steps=num_test_examples/epochs,
epochs=epochs)
The text was updated successfully, but these errors were encountered: