Skip to content
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

Add support for iterators in Interpreter.predict #511

Merged
merged 4 commits into from Sep 21, 2020

Conversation

lgeiger
Copy link
Member

@lgeiger lgeiger commented Sep 19, 2020

This adds support for iterators as input to Interpreter.predict() and improves the readability by explicitely handling iterations by data_generator().

This makes it possible to support tf.data.Dataset as inputs via Interpreter.predict(dataset.as_numpy_iterator()) or Interpreter.predict(tfds.as_numpy(dataset)).
I didn't add support for directly passing a tf.data.Dataset, since .as_numpy_iterator() is only available in newer versions of TensorFlow with eager execution enabled and tfds.as_numpy would require an additional dependency.

@lgeiger lgeiger added the feature New feature or request label Sep 19, 2020
@lgeiger lgeiger requested a review from a team September 19, 2020 12:15
Co-authored-by: Adam Hillier <7688302+AdamHillier@users.noreply.github.com>
@lgeiger lgeiger merged commit ca5f8dd into master Sep 21, 2020
@lgeiger lgeiger deleted the simplify-interpreter branch September 21, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants