# C4W3 Exercise 1 in Autonomous_driving_application_Car_detection

Exercise 1 in Autonomous_driving_application_Car_detection

What are these two lines mean? I cannot find any explaination in the introductory text.
x = 10
y = tf.constant(100)

I am also getting strange testing results. My code got the following results:

scores[2] = 0.09270486
boxes[2] = [ 4.6399336 3.2303846 4.431282 -2.202031 ]
classes[2] = 8
scores.shape = (1402,)
boxes.shape = (1402, 4)
classes.shape = (1402,)

While expected outcome is:

scores[2]9.270486
boxes[2][ 4.6399336 3.2303846 4.431282 -2.202031]
classes[2]8
scores.shape(1789,)
boxes.shape(1789, 4)
classes.shape(1789,)

I noticed the input class probability is in the range of 1~100, so I divided it with y = 100. I was able to get some test result right, and some smaller by a factor of 100, and others within reasonable range. What could I have done wrong?

Those variables x and y are not used. Theyâll be removed in the next update to the notebook.

For your other strange results: Please identify exactly which function you were working on. Iâm going to guess it was âyolo_filter_boxesâ.

You should not be using that âyâ variable.

What exactly do you mean by âinput class probabilityâ?

Does your code pass the unit tests?

Yes it is yolo_filter_boxes. It didnât pass the unit test.

What I did:

step 1: element-wise multiply of âbox_confidenceâ and âbox_class_probsâ
step 2: use tf.math.argmax to get âbox_classesâ from âbox_scoresâ, axis = -1
use tf.math.reduce_max to get âbox_class_scoresâ from âbox_scoresâ, axis = -1
step 3: direct compare if âbox_class_scoresâ is smaller than âthresholdâ
(here I noticed data inside âbox_class_scoresâ is in range of 0-100, so I must have done something wrong before this step?)

step 4: use tf.boolean_mask to get outputs.

I also have done something very similar to this but I get an error Cannot convert 0.5 to EagerTensor of dtype int64 If I divide the probabilities by 100 i get a shape of 324,

1 Like

Seems like you need a type conversion on your tensor?

No help?

I also tried to multiply threshhold by 240, and the unit test result matches. That didnât get me the correct model of course.

Any help would be great, really stuck here. At least tell me there is nothing wrong with the test dataâŚ

Hello zhuliyi0,

Do not hesitate to read the statement again as well as the comment telling you what to do, check if it matches your code.