Created
June 25, 2021 13:43
-
-
Save eileen-code4fun/fc11e5f6de2b7d553c04dc0f29aa4ea6 to your computer and use it in GitHub Desktop.
CIFAR10 TFDV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow_data_validation as tfdv | |
from tensorflow_metadata.proto.v0 import anomalies_pb2 | |
stats = tfdv.load_stats_binary(GCS_PATH_FOR_STATS_PB) | |
tfdv.visualize_statistics(stats) | |
# Display output in screenshot later. | |
schema = tfdv.load_schema_text(GCS_PATH_FOR_SCHEMA_PBTXT) | |
tfdv.display_schema(schema) | |
# Display output in screenshot later. | |
anomalies = anomalies_pb2.Anomalies() | |
from google.cloud import storage | |
anomalies_bytes = storage.Client().get_bucket(GCS_BUCKET).blob(PATH_FOR_ANOMALIES_PB).download_as_string() | |
anomalies.ParseFromString(anomalies_bytes) | |
tfdv.display_anomalies(anomalies) | |
# Display output: | |
# No anomalies found. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment