# Error in week3 assignment 1 excercise 1

nvalidArgumentError Traceback (most recent call last)
in
4 boxes = tf.random.normal([19, 19, 5, 4], mean=1, stddev=4, seed = 1)
5 box_class_probs = tf.random.normal([19, 19, 5, 80], mean=1, stddev=4, seed = 1)
----> 6 scores, boxes, classes = yolo_filter_boxes(boxes, box_confidence, box_class_probs, threshold = 0.5)
7 print("scores[2] = " + str(scores[2].numpy()))
8 print("boxes[2] = " + str(boxes[2].numpy()))

in yolo_filter_boxes(box_confidence, boxes, box_class_probs, threshold)
21 # Step 1: Compute box scores
22 ### START CODE HERE ### (≈ 1 line)
—> 23 box_scores = box_class_probs*box_confidence
24 ### END CODE HERE #
25

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py in binary_op_wrapper(x, y)
1123 with ops.name_scope(None, op_name, [x, y]) as name:
1124 try:
→ 1125 return func(x, y, name=name)
1126 except (TypeError, ValueError) as e:
1127 # Even if dispatching the op failed, the RHS may be a tensor aware

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py in _mul_dispatch(x, y, name)
1455 return sparse_tensor.SparseTensor(y.indices, new_vals, y.dense_shape)
1456 else:
→ 1457 return multiply(x, y, name=name)
1458
1459

/opt/conda/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)
199 “”“Call target, and fall back on dispatchers if there is a TypeError.”""
200 try:
→ 201 return target(*args, **kwargs)
202 except (TypeError, ValueError):
203 # Note: convert_to_eager_tensor currently raises a ValueError, not a

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py in multiply(x, y, name)
507 “”"
508
→ 509 return gen_math_ops.mul(x, y, name)
510
511

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gen_math_ops.py in mul(x, y, name)
6164 return _result
6165 except _core._NotOkStatusException as e:
→ 6166 _ops.raise_from_not_ok_status(e, name)
6167 except _core._FallbackException:
6168 pass

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in raise_from_not_ok_status(e, name)
6841 message = e.message + (" name: " + name if name is not None else “”)
6842 # pylint: disable=protected-access
→ 6843 six.raise_from(core._status_to_exception(e.code, message), None)
6844 # pylint: enable=protected-access
6845

/opt/conda/lib/python3.7/site-packages/six.py in raise_from(value, from_value)

InvalidArgumentError: Incompatible shapes: [19,19,5,80] vs. [19,19,5,4] [Op:Mul]

I can’t understand why i am getting this error I have checked the code many times but still couldn’t find anything

1 Like

I think I might have a similar problem

1 Like

1 Like

no, not yet. I don’t seem to know what I am doing wrong

1 Like

Please let me know if you get it right

1 Like

I’m having a similar error in Ex4…

1 Like

hopefully we get some help

1 Like

I’m also having the same problem.
The same question was asked on May 16 but know much insight found to solve the error.

1 Like

I’m now able to solve the problem. I passed wrong argument but you guys have passed correct argument.

1 Like