C4W3 Exercise 1

Hello all,

I struggle with exercise 1 of this week course, though I have completed exercise 2 already.

I tried to create the filtering mask like this: filtering_mask = tf.greater(box_class_scores, threshold)
and applied it, for example to box_class_scores, like this:
scores = tf.boolean_mask(box_class_scores, filtering_mask).
When I run the test cell, I get the error that the mask cannot be a scalar.
When I tried to create a tensor using the threshold scalar like this: tf. scalar(threshold), I get the an AttributeError that the module ‘tensorflow’ has no attribute '‘scalar’

Could someone, please, help me solve this ?

Thank you

If you tried a search with some targeted keywords, say


you might have found this post with exactly the same root problem

Let us know if it helps?

1 Like

Yes it helps, many thanks!

1 Like