W2 Assignment! Bucketizing Error

Hi,
I am getting an error TypeError: num_buckets must be an int, got <class ‘dict’>
while doing the test your preprocessing in the week 2 feature engineering assignment of MLOPS
Can u please help
@balaji.ambresh sir

Check the variable num_buckets, it says its a dictionary it should be an integer!

As @gent.spah rightly points out the type mismatch error, see this to better understand the parameters.
Moving forward, please share the stacktrace (and not the code) when possible on your posts.

1 Like

Hi thank u . Yes il share the stack trace sir. @gent.spah and @balaji.ambresh .i cleared that error but came up with another one.

@Rachel_Nallathamby
The error message indicates that you’re trying to call a dictionary object as if it were a function.
Try using [] rather than ()
Change this:
traffic_volume = tf.cast(inputs(_VOLUME_KEY), tf.int32)

to

traffic_volume = tf.cast(inputs[_VOLUME_KEY], tf.int32)

Let us know if it works

2 Likes

Thanks so much! Got it… But when i submit im still getting a grade 0. Although all my test cases have passed…
Ok i refreshed the workspace and tried again.
It worked