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

mrcnn_class_loss function/dataset problem #6

Open
gaborvecsei opened this issue Aug 27, 2018 · 2 comments
Open

mrcnn_class_loss function/dataset problem #6

gaborvecsei opened this issue Aug 27, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@gaborvecsei
Copy link

gaborvecsei commented Aug 27, 2018

I tried to train a simple model with your code, but unfortunately I get the following error when I try to train:

InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [4 16] [y (mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [1 64]
	 [[Node: mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/All/_4229, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert/data_0, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert/data_1, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert/data_2, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/Shape/_4231, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert/data_4, mrcnn_class_loss/SparseSoftmaxCrossEntropyWithLogits/strided_slice/_4233)]]

As I see the problem is with the tensor shapes, so it can happen that there is a problem with my dataset.

  • When I call dataset.load_image(...) it returns an image with shape (128, 128, 3)
  • When I call dataset.load_bbox(...) it returns a list of bounding boxes with shape: (nb_of_bboxes, 4) and a list of class ids to the corresponding bboxes

I hope you encountered with the same problem and can help me with this.

@gaborvecsei
Copy link
Author

gaborvecsei commented Sep 3, 2018

I think the problem is with the VotePooling.

Instead of pooled = tf.expand_dims(pooled, 0) the right output is pooled = tf.reshape(pooled, (self.batch_size, self.num_rois, self.channel_num)) as your comment says that the returned tensor should have a shape of (batch, num_rois, class_num)

Could you confirm?

@parap1uie-s parap1uie-s added the bug Something isn't working label Feb 13, 2019
@parap1uie-s
Copy link
Owner

I only tested the model under batch_size=1
It seems that the model goes wrong when bs>1

Bug labeled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants