ahmadsum11
May 12th, 2023
83
0
Never
This is comment for paste Testing divide_img_blocks method
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ValueError Traceback (most recent call last)
  2. Cell In[79], line 4
  3. 2 n_tests = 1000
  4. 3 for i in range(n_tests):
  5. ----> 4 blocks = divide_img_blocks(np.random.rand(randint(10,1000), randint(10,1000), 3), (randint(2,100), randint(2,100)))
  6.  
  7. Cell In[67], line 4, in divide_img_blocks(img, n_blocks)
  8. 2 horizontal = np.array_split(img, n_blocks[0])
  9. 3 splitted_img = [np.array_split(block, n_blocks[1], axis=1) for block in horizontal]
  10. ----> 4 return np.asarray(splitted_img, dtype=np.ndarray).reshape(n_blocks)
  11.  
  12. ValueError: could not broadcast input array from shape (10,5,3) into shape (10,)
Advertisement
Add Comment
Please, Sign In to add comment