# Concolutional Networks Week 3. Assignment 1, exercies one

**URL:** <https://community.deeplearning.ai/t/concolutional-networks-week-3-assignment-1-exercies-one/94138>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [February 2, 2022, 12:35am UTC](https://community.deeplearning.ai/t/concolutional-networks-week-3-assignment-1-exercies-one/94138 "2022-02-02T00:35:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ghassan\_Maalouli](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Ghassan\_Maalouli](https://community.deeplearning.ai/u/Ghassan_Maalouli)\
**Post date:** [February 2, 2022, 12:35am UTC](https://community.deeplearning.ai/t/concolutional-networks-week-3-assignment-1-exercies-one/94138/1 "2022-02-02T00:35:08Z")

</div>

I follow the instructions to compute the mask

filtering\_mask = (box\_class\_scores \>= threshold)

TypeError: Cannot convert 0.5 to EagerTensor of dtype int64

Any idea why it is doing that?

Thanks

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [February 2, 2022, 12:51am UTC](https://community.deeplearning.ai/t/concolutional-networks-week-3-assignment-1-exercies-one/94138/2 "2022-02-02T00:51:50Z")

</div>

That is a common problem. It means the type of your _box\_class\_scores_ tensor is wrong. You are probably mixing up the classes and the scores. The classes are integer values, but the scores are not.

I added a bunch of instrumentation to my code for that section. Here’s what I see with correct code:

```auto
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'>
filtering_mask.shape (19, 19, 5)
filtering_mask.dtype <dtype: 'bool'>
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!

```

---

<div class="post-metadata">

**Author:** ![ai\_curious](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ai_curious/32/128003_2.png) [@ai\_curious](https://community.deeplearning.ai/u/ai_curious)\
**Post date:** [February 2, 2022, 1:46am UTC](https://community.deeplearning.ai/t/concolutional-networks-week-3-assignment-1-exercies-one/94138/3 "2022-02-02T01:46:20Z")

</div>

> [@Ghassan\_Maalouli](#):
>
> TypeError: Cannot convert 0.5 to EagerTensor of dtype int64

You could always give search a try…

[https://community.deeplearning.ai/search?q=TypeError%3A%20Cannot%20convert%200.5%20to%20EagerTensor%20of%20dtype%20int64](https://community.deeplearning.ai/search?q=TypeError%3A%20Cannot%20convert%200.5%20to%20EagerTensor%20of%20dtype%20int64)
