How do I change the tensor dimensions (size) of images into [64, 32]?

26 views Asked by At

Im classifying images of an imbalanced Cifar100 dataset by transforming the images into tensors into hyperbolic space, and also using embeddings of a hierarchy in hyperbolic space. The Images after loading them in have torch.size([64, 3, 32, 32]). The images then get put into a custom resnet model and the outputs of the images needs to have torch.size([64, 32]).

The embeddings have torchsize([127, 32]). How can I make sure the images after they are put in the model, have the correct torch.size?

p.s. the resnet model contains expmap0 and poincarebal

I constantly get the error: "RuntimeError: The size of tensor a (32) must match the size of tensor b (127) at non-singleton dimension 3

0

There are 0 answers