ConcatOp error when changing layer_depth=3 to a larger value in circle demo.
avose opened this issue · 3 comments
Thanks much for your project and making your source available to others! : ) Wondering if someone may be able to help with an issue I'm having.
I took the code from the circle.ipynb demo and made a .py demo from it (copy / paste). Everything is working great there. However, when I change layer_depth=3
to a new value, I get ConcatOp
errors.
I change:
unet_model = unet.build_model(channels=circles.channels, num_classes=circles.classes, layer_depth=3, filters_root=16)
To be:
unet_model = unet.build_model(channels=circles.channels, num_classes=circles.classes, layer_depth=4, filters_root=16)
Then I see errors when I try to run:
tensorflow.python.framework.errors_impl.InvalidArgumentError: ConcatOp : Dimensions of inputs should match: shape[0] = [1,64,35,35] vs. shape[1] = [1,64,34,34] [[node unet/crop_concat_block/concat (defined at /home/avose/workspace/butterfly/synth/bf_unet/unet/unet.py:130) ]] [Op:__inference_distributed_function_2008]
Any tips would be greatly appreciated. I have also been playing with the TF1.x version of unet, and that version does seem to allow me to change the layer depth option without giving any errors.
Hi @avose, thanks for reporting this.
Looks like, that the resolution that I used in the demo and layer_depth=4
is resulting in feature maps that can't be concatenated (35 vs 34 pixels).
I've run the demo using images of size 572x572 (as proposed in the original paper) and then the problem doesn't occur:
circles.load_data(100, nx=572, ny=572, r_max=20)
I will have to dig a bit deeper to figure out what is really causing this issue
Yay! Thanks much; I was able to merge your new master into my branch, and this seems to have fixed the issue for me. : )