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

Incompatible shapes: [8873,1] vs. [9432,2] #41

Closed
lazydroid opened this issue Jan 29, 2019 · 5 comments
Closed

Incompatible shapes: [8873,1] vs. [9432,2] #41

lazydroid opened this issue Jan 29, 2019 · 5 comments

Comments

@lazydroid
Copy link

lazydroid commented Jan 29, 2019

I'm using TF 1.13, would be glad to use 1.4, but it depends on CUDA 8, and I'm already on CUDA 10, with other my project are depending on it. So, going back to TF 1.4 / CUDA 8 is not an option, sorry.

Once I have ignored the error mentioned in the issue #40, the next show stopper is a message about incompatible types. Having tensor sizes, I could probably have searched through the code and fix it, but the problem is, the tensor size and dimension change every time. It could be a plain vector with 25k versus 45k values, or a 2-d matrix with approximately [XXXX, 1] vs. [YYYY, 2], where YYYY is always slightly larger than XXXX, and both could have values from 7k to 20k.

Here are the outputs from the subsequent runs, nothing changed in the data, I just use rm -rf saved; ./model -dataset COCO, and the numbers keep changing. Could anyone explain what's the reason and how to fix this, please ?

tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 25896 values, but the requested shape has 44928
	 [[node optimizer/gradients/boxnet/Box/BoxNetwork/RPN/mergeBoxData/Reshape_grad/Reshape (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]

tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [8873,1] vs. [9432,2]
	 [[node optimizer/gradients/RPNloss/cond/calcRPNLoss/calcAllRPNLosses/softmax_cross_entropy_with_logits_sg_grad/mul (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]

tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [12270,1] vs. [12948,2]
	 [[node optimizer/gradients/RPNloss/cond/calcRPNLoss/calcAllRPNLosses/softmax_cross_entropy_with_logits_sg_grad/mul (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]

tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [8280,1] vs. [9988,2]
	 [[node optimizer/gradients/RPNloss/cond/calcRPNLoss/calcAllRPNLosses/softmax_cross_entropy_with_logits_sg_grad/mul (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]

tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [7359,1] vs. [8320,2]
	 [[node optimizer/gradients/RPNloss/cond/calcRPNLoss/calcAllRPNLosses/softmax_cross_entropy_with_logits_sg_grad/mul (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]

tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [17058,1] vs. [18868,2]
	 [[node optimizer/gradients/RPNloss/cond/calcRPNLoss/calcAllRPNLosses/softmax_cross_entropy_with_logits_sg_grad/mul (defined at ./main.py:105) ]]
	 [[optimizer/gradients/cond/getRefinementLoss/cond_1/getNetLoss/classRefinementLoss/getBoxScores/roiMean/Mean_grad/truediv/_2009]]
@jetsmith
Copy link

jetsmith commented Mar 5, 2019

i had the same problem, first time: [15878,1] vs. [15908,2], second time: [14151,1] vs. [14724,2], have you solved it?

@jetsmith
Copy link

jetsmith commented Mar 5, 2019

@lazydroid

@lazydroid
Copy link
Author

@jetsmith I have stopped using COCO dataset, put my files and classes and boxes in .CSV file and since then it went well. No idea about the reason of the original error.

@maliyong
Copy link

Have you solved it ? @jetsmith

@chenwanqq
Copy link

@maliyong Change your tensorflow version to 1.4, then it'll be all solved

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

4 participants