When I try running ExampleValidator, I get this error. I’m confused, because above we’re supposed to create a StatisticsGen object, but it says that’s the wrong type??
TypeError Traceback (most recent call last)
in
1 ### START CODE HERE ###
2
----> 3 example_validator = ExampleValidator(
4 statistics = statistics_gen_updated,
5 schema = user_schema_importer
/opt/conda/lib/python3.8/site-packages/tfx/components/example_validator/component.py in init(self, statistics, schema, exclude_splits, output, stats, instance_name)
98 if not anomalies:
99 anomalies = types.Channel(type=standard_artifacts.ExampleAnomalies)
→ 100 spec = ExampleValidatorSpec(
101 statistics=statistics,
102 schema=schema,
/opt/conda/lib/python3.8/site-packages/tfx/types/component_spec.py in init(self, **kwargs)
139 self._validate_spec()
140 self._verify_parameter_types()
→ 141 self._parse_parameters()
142
143 def eq(self, other):
/opt/conda/lib/python3.8/site-packages/tfx/types/component_spec.py in _parse_parameters(self)
210 if arg.optional and value is None:
211 continue
→ 212 arg.type_check(arg_name, value)
213
214 # Populate the appropriate dictionary for each parameter type.
/opt/conda/lib/python3.8/site-packages/tfx/types/component_spec.py in type_check(self, arg_name, value)
393 def type_check(self, arg_name: Text, value: Channel):
394 if not isinstance(value, Channel) or value.type != self.type:
→ 395 raise TypeError('Argument %s should be a Channel of type %r (got s).'
396 (arg_name, self.type, value))
TypeError: Argument statistics should be a Channel of type <class ‘tfx.types.standard_artifacts.ExampleStatistics’> (got StatisticsGen(spec: <tfx.types.standard_component_specs.StatisticsGenSpec object at 0x7f24dd72be80>, executor_spec: <tfx.components.base.executor_spec.ExecutorClassSpec object at 0x7f2480cfc8b0>, driver_class: <class ‘tfx.components.base.base_driver.BaseDriver’>, component_id: StatisticsGen, inputs: {‘examples’: Channel(
type_name: Examples
artifacts: [Artifact(artifact: id: 6
type_id: 7
uri: “./pipeline/CsvExampleGen/examples/6”
properties {
key: “split_names”
value {
string_value: “[“train”, “eval”]”
}
}
custom_properties {
key: “input_fingerprint”
value {
string_value: “split:single_split,num_files:1,total_bytes:27713036,xor_checksum:1635357588,sum_checksum:1635357588”
}
}
custom_properties {
key: “payload_format”
value {
string_value: “FORMAT_TF_EXAMPLE”
}
}
custom_properties {
key: “span”
value {
string_value: “0”
}
}
custom_properties {
key: “state”
value {
string_value: “published”
}
}
, artifact_type: id: 7
name: “Examples”
properties {
key: “span”
value: INT
}
properties {
key: “split_names”
value: STRING
}
properties {
key: “version”
value: INT
}
)]
), ‘schema’: Channel(
type_name: Schema
artifacts: [Artifact(artifact: id: 9
type_id: 9
uri: “./pipeline/updated_schema”
, artifact_type: id: 9
name: “Schema”
)]
)}, outputs: {‘statistics’: Channel(
type_name: ExampleStatistics
artifacts: [Artifact(artifact: id: 10
type_id: 5
uri: “./pipeline/StatisticsGen/statistics/10”
properties {
key: “split_names”
value {
string_value: “[“train”, “eval”]”
}
}
custom_properties {
key: “name”
value {
string_value: “statistics”
}
}
custom_properties {
key: “producer_component”
value {
string_value: “StatisticsGen”
}
}
custom_properties {
key: “state”
value {
string_value: “published”
}
}
, artifact_type: id: 5
name: “ExampleStatistics”
properties {
key: “span”
value: INT
}
properties {
key: “split_names”
value: STRING
}
)]
)})).