Feeding a Transformer with a matrix

14 Views Asked by At

I have a folder that has grayscale images of 32 x 32 pixel of handwritten characters. I divide each image into segments of size 8x8 pixels. Then each segment is then divided into sub-segments of size 2x2 pixels. I keep the original image location for each sub-segment. Normally I will result in a matrix of 16 rows and 16 columns, each element of which is a sub-segment of 2 x 2 pixels. This is why I created a Transformer which accepts a 16 x 16 matrix as input. Every time I start training this model, an error occurs: "RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x1024 and 2x256)". Help me to solve this issue please.

0

There are 0 best solutions below