votes up 2

Cannot divide evenly the sizes of shapes (tuple(s1)) and (tuple(s2))

Package:
jax
github stars 14057
Exception Class:
InconclusiveDimensionOperation

Raise code

""" 
    contexts,
    """
    sz1 = int(np.prod(s1))
    sz2 = int(np.prod(s2))
    if sz1 == 0 and sz2 == 0:
      return 1
    if sz1 % sz2:
      raise InconclusiveDimensionOperation(f"Cannot divide evenly the sizes of shapes {tuple(s1)} and {tuple(s2)}")
    return sz1 // sz2

  def stride(self, d: DimSize, window_size: DimSize, window_stride: DimSize) -> DimSize:
    """(d - window_size) // window_stride + 1"""
    return (d - window_size) // window_stride + 1

  def dilate(self, d: DimSize, dilation: int) -> DimSize:
🙏 Scream for help to Ukraine
Today, 14th August 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 2 votes down

I told Jax to make a 512 by 853 image. It Failed

Error: cannot divide evenly the sizes of shapes (1, 128, 512, 853)

Because 512 and 853 both have to be dimensions of 128.

adjusting the size I told it to produce to 512, 896 eliminated the error.

Jul 28, 2022 mikelancastertech answer

Add a possible fix

Please authorize to post fix