为了训练基于深度学习的模型,我有一个输入张量,其大小为batch_size=32、channels=3、Temporal=16、H=128、w=192,包括视频帧。我需要调整张量的空间大小(H=224,w=224)。换句话说,我需要一个batch_size=32,channels=3,Temporal=16,H=224,w=224大小的张量。我怎么能这么做?
发布于 2022-10-03 12:48:52
您可以使用torch.nn.functional.interpolate
import torch.nn.functional as nnf
y = nnf.interpolate(x, size=(x.shape[2], 224, 224), mode='trilinear')https://stackoverflow.com/questions/73935523
复制相似问题