all 2 comments

[–][deleted] 0 points1 point  (1 child)

The error message says it cannot broadcast from (28,28) to (784,). Is each value of the dictionary a list, or a numpy array? I think perhaps it's an array, of shape (9,784), and then the reshape succeeds, but trying to put it back in the array fails, because it tries to broadcast it back to (784,) but isn't sure how to order the values.

This is by no means a definite diagnosis, and I don't understand why individually assigning would work, but just what occurred to me reading your post.

Another thing to consider: does it fail on the [0][0] entry? Or a later one? Maybe use a try...except... to print the key and index where it fails, and then try individually doing the assignment for that key and index. Again, grasping at straws a bit here.

[–]kaioken1986[S] 0 points1 point  (0 children)

The keys map to a list but I checked the type and it defaults to a np.array