Melp c2 , week 2 , assignment not working , excercise 6

Hi @Yomna_Mohamed
Please check the Tensorflow reference. Follow the notebook instruction and add the inputs of _VOLUME_KEY and cast it float32

[snippet deleted by mentor]

please check

as it isnt working , tf cast

There is no always_return_num_quantiles keyword argument in bucketize. This error has nothing to do with tf.cast.

This is the tail of your stacktrace:

~/work/traffic_transform.py in preprocessing_fn(inputs)
     53     # Bucketize the feature
     54     for key in _BUCKET_FEATURE_KEYS:
---> 55         outputs[_transformed_name(key)] = tft.bucketize(
     56             inputs[key],
     57             _FEATURE_BUCKET_COUNT[key],

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/common.py in wrapped_fn(*args, **kwargs)
     71             collection.append(collections.Counter())
     72           collection[0][fn.__name__] += 1
---> 73           return fn(*args, **kwargs)
     74       else:
     75         return fn(*args, **kwargs)

TypeError: bucketize() got an unexpected keyword argument 'always_return_num_quantiles'

please where is the error so i can fix it

Based on the trace, the location is in preprocessing_fn(inputs) where tft.bucketize is invoked in line 55.

Please get familiar with python before moving forward.

i mean where the error in the syntax

Does this help?

i removed the argumnets
now gives this error

NameError Traceback (most recent call last)
in
10 importlib.reload(traffic_transform)
11
—> 12 raw_data_metadata = dataset_metadata.DatasetMetadata(schema_utils.schema_from_feature_spec(feature_description))
13
14 with tft_beam.Context(temp_dir=tempfile.mkdtemp()):

NameError: name ‘dataset_metadata’ is not defined

Odds are good that your kernel restarted due to inactivity. Run the cell that contains this import:
from tensorflow_transform.tf_metadata import dataset_metadata, schema_utils

1 Like

i cant find it where

worked ;))) i re run it again

i got grade 0 even all output matched

There was a problem compiling the code from your notebook. Details:
name ‘CsvExampleGen’ is not defined

Hello @Yomna_Mohamed to avoid the ‘CsvExampleGen’ is not defined error try adding tfx.components to the CsvExampleGen Like this:

tfx.components.CsvExampleGen

Let me know if the error will be solved!

where to put this syntax

Where you defined: CsvExampleGen

Or send a screenshot of your error I have a better look

@Yomna_Mohamed Please delete this! You can’t share your notebook here,

DM me the notebook instead

@Yomna_Mohamed Delete the post and inbox me the file privately! Click on my display photo and you will get an option Message


TypeError Traceback (most recent call last)
in
4
5 # Use ImportSchemaGen to put the curated schema to ML Metadata
----> 6 user_schema_importer = ImporterNode(
7 instance_name= ‘import_user_schema’,
8 source_uri= UPDATED_SCHEMA_DIR,

/opt/conda/lib/python3.8/site-packages/tfx/utils/deprecation_utils.py in init(self, *args, **kwargs)
145 f’From {call_loc}: The name {deprecated_name} is deprecated. ’
146 f’Please use {name} instead.')
→ 147 super().init(*args, **kwargs)
148
149 return _NewDeprecatedClass

TypeError: init() got an unexpected keyword argument ‘instance_name’

============
error in week 3 c3

1 Like

@Yomna_Mohamed , the comment specify that you should use ImportSchemaGen, not ImporterNode in cell 5.

In the future, please create a new topic if the issue is from a different assignment.