# Exercise 1 - yolo_filter_boxes Assignement 1 W3

Hello,

I’m getting this error when compiling the code “Cannot convert 0.5 to EagerTensor of dtype int64”.

Throught my research on the forum, it apears that the mask shoudl be created based on box_class_scores, but those represent the classes which are intergers from 1 to 80.

So the logic says that the mask should be applied the box_classes ( because here we have the maximum of box scores and this maximum is float between 0 and 1.

But i get the error after applying this.

I think you have classes and scores reversed in your thinking there (at least in your first statement). The classes are integers, but the scores are the floating point values, right?

I added a bunch of print statements to my logic for yolo_filter_boxes to show the shapes and types of everything. Here’s what I see:

boxes.shape (19, 19, 5, 4)
boxes.dtype <dtype: 'float32'>
box_scores.shape (19, 19, 5, 80)
box_scores.dtype <dtype: 'float32'>
box_classes.shape (19, 19, 5)
box_classes.dtype <dtype: 'int64'>
box_class_scores.shape (19, 19, 5)
box_class_scores.dtype <dtype: 'float32'>
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,)
All tests passed!


Yes, it is
classes are intergers from 1 to 80
and scores are floats between 0 and 1
right ?

When I print the box_class_scores of the example given it returs floats > 1 that’s what I don’t get:

array([[[ 7.8824973 , 15.941693 , 9.270486 , 10.659197 ,
11.924357 ],
[ 90.77388 , 5.974023 , 1.8933523 , 29.829315 ,
31.208069 ],
[ 6.537015 , 41.7416 , 23.049517 , 37.349552 ,
13.52168 ],
…,
[ 62.409065 , 33.47416 , 11.878175 , 59.977737 ,
21.68427 ],
[ 10.253807 , 50.624313 , 71.08136 , 21.55704 ,
20.643707 ],
[ 44.418617 , 6.1362724 , 39.162514 , 53.065334 ,
17.46208 ]],