funkelab / funlib.learn.tensorflow

Commonly used `tensorflow` models and losses.
1 stars 6 forks source link

invalid comparison of tuple and list in crop_to_factor #7

Open abred opened 4 years ago

abred commented 4 years ago

https://github.com/funkelab/funlib.learn.tensorflow/blob/6ca8092408241d439d572fe179b85cc32782cc03/funlib/learn/tensorflow/models/unet.py#L464

target_spatial_shape is a tuple and spatial_shape is a list, at least for my Python version those are always unequal and thus the inequality comparison is always true

    if target_spatial_shape != tuple(spatial_shape):
virgoli commented 1 year ago

https://github.com/funkelab/funlib.learn.tensorflow/blob/6ca8092408241d439d572fe179b85cc32782cc03/funlib/learn/tensorflow/models/unet.py#L464

target_spatial_shape is a tuple and spatial_shape is a list, at least for my Python version those are always unequal and thus the inequality comparison is always true

    if target_spatial_shape != tuple(spatial_shape):

i got the same problem, assertionerror feature mao with shape...is too small to ensure..... have u solved it now?

abred commented 1 year ago

@virgoli you are describing a different error. The output size of the network has to be big enough to ensure translation equivariance (see https://arxiv.org/abs/2101.05846). You have to increase the input size. (With valid padding the output is smaller than the input)