【发布时间】:2021-05-04 23:23:43
【问题描述】:
我正在研究张量,想用torchvision.transforms.RandomRotation 旋转它们并使用fill 选项。
import torch
import torchvision
img1 = torch.rand((1, 16, 16))
img2 = torchvision.transforms.RandomRotation(45, fill=1)(img1)
但是,我总是得到:
Tensor 输入不支持参数填充/填充颜色。填充值为零
它没有被填满。我对torchvision.transforms.RandomPerspective 有同样的问题。
我正在使用 Python 3.8 和 PyTorch 1.7.1。我尝试使用fill=(1,),这似乎是一种解决方法,但它对我不起作用。你知道有什么问题吗?
【问题讨论】:
标签: python pytorch data-augmentation torchvision