-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
ValueError: logits and labels must have the same shape #37
Comments
Hi @dpoiesz !
I assume that your input images and masks are of size 256x256? |
Thank you very much for responding, I'll try larger chips and let you know how it works out! |
Unfortunately, increasing the input size did not help. A similar error is still received. As I stated before this is very confusing since all I did was swap out my function for yours. The code works fine for the code that uses "same" padding. Any ideas on what I should look at next? 1/1052 [..............................] - ETA: 4:14:15Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
512x512 is now both your input size and output mask size, right? That's incorrect for vanilla unet. |
I receive the above error when attempting to train the vanilla_unet. The pipeline works for a unet I wrote that uses "same" padding but was hoping to try the vanilla_unet for it's "valid" padding. I'm not sure what else in my code could have caused this error and would have expected these conditions to have been handled inside the vanilla_unet. Any Recommendations?
initial stack trace below:
Traceback (most recent call last):
File "C:\Users\dpoiesz\Repos\bespin\venv\bespin\lib\site-packages\tensorflow_core\python\framework\tensor_shape.py", line 926, in merge_with
new_dims.append(dim.merge_with(other[i]))
File "C:\Users\dpoiesz\Repos\bespin\venv\bespin\lib\site-packages\tensorflow_core\python\framework\tensor_shape.py", line 309, in merge_with
self.assert_is_compatible_with(other)
File "C:\Users\dpoiesz\Repos\bespin\venv\bespin\lib\site-packages\tensorflow_core\python\framework\tensor_shape.py", line 276, in assert_is_compatible_with
(self, other))
ValueError: Dimensions 256 and 68 are not compatible
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\dpoiesz\Repos\bespin\venv\bespin\lib\site-packages\tensorflow_core\python\ops\nn_impl.py", line 167, in sigmoid_cross_entropy_with_logits
labels.get_shape().merge_with(logits.get_shape())
File "C:\Users\dpoiesz\Repos\bespin\venv\bespin\lib\site-packages\tensorflow_core\python\framework\tensor_shape.py", line 929, in merge_with
raise ValueError("Shapes %s and %s are not compatible" % (self, other))
ValueError: Shapes (None, 256, 256, 1) and (None, 68, 68, 1) are not compatible
The text was updated successfully, but these errors were encountered: