Course 2 week 3 assignment
Use an ImporterNode to put the curated schema to ML Metadata
user_schema_importer = Importer(
source_uri=UPDATED_SCHEMA_DIR, # directory containing only schema text proto
artifact_type=standard_artifacts.Schema).with_id(‘import_user_schema’)
Why I kept getting this error:
NameError Traceback (most recent call last)
in 2
3 # Use an ImporterNode to put the curated schema to ML Metadata----> 4 user_schema_importer = Importer(
5 source_uri=UPDATED_SCHEMA_DIR, # directory containing only schema text proto 6 artifact_type=standard_artifacts.Schema).with_id(‘import_user_schema’)
NameError: name ‘Importer’ is not defined
Hi! I think you intend to use the ImporterNode
component. There is no component named Importer
so it will throw an error. Hope this helps!
Hi Chris,
Thanks for your clarification!
But in the assignment, it specifically indicates the following:
4.7 - Generate new statistics using the updated schema
You will now compute the statistics using the schema you just curated. Remember though that TFX components interact with each other by getting artifact information from the metadata store. So you first have to import the curated schema file into ML Metadata. You will do that by using an ImporterNode to create an artifact representing the curated schema.
Hi Chris,
I got it resolved. It should use ImporterNode instead of Importer.
Thanks,
Robin
Hi Robin! I see that the command in the external link has a typo (or it may be for a different version of TFX). The ungraded lab uses ImporterNode
so I thought the same command is shown in the link. I will verify if the command in the link is merely a typo or for a different version. Thank you for bringing this to my attention! Glad you were able to resolve it.
1 Like