Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Train error. #1

Open
herrickli opened this issue Apr 5, 2021 · 2 comments
Open

Train error. #1

herrickli opened this issue Apr 5, 2021 · 2 comments

Comments

@herrickli
Copy link

Hi, I use instruction train_cascade_rcnn.ipynb to trian cascade rcnn on my custom dataset, and I got this error

Traceback (most recent call last):
  File "train.py", line 33, in <module>
    _ = model((batch_imgs, batch_metas), training=False)
  File "/cascade-rcnn-tf2.2/detection/models/detectors/cascade_rcnn.py", line 208, in __call__
    proposals = transforms.delta2bbox(rois, rcnn_deltas, self.RCNN_TARGET_MEANS, self.RCNN_TARGET_STDS)
  File ''/cascade-rcnn-tf2.2/detection/core/bbox/transforms.py", line 72, in delta2bbox
    center_y += delta[:, 0] * height
  File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/math_ops.py", line 899, in binary_op_wrapper
    return func(x, y, name=name)
  File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/math_ops.py", line 1206, in _mul_dispatch
    return gen_math_ops.mul(x, y, name=name)
  File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_math_ops.py", line 6698, in mul
    _six.raise_from(_core._status_to_exception(e.code, message), None)
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [2000,4] vs. [2000] [Op:Mul] name: mul/

There are 8 classes in my custom dataset, the delta in delta2bbox function has shape of (2000,9,4), how should I fix this error to train my own dataset, thanks a lot.

@HirataYurina
Copy link
Owner

Maybe you need to set a background label in you label file.

@HirataYurina
Copy link
Owner

Have fixes this bugs and update your codes, bro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants