Model UNet1DModel

Hi, I’m new to using HuggingFace.
I try to set up the model UNet1DModel and I can’t get output working:
from diffusers import UNet1DModel

batch_size, sample_size, num_channels = 1, 128, 1
model = UNet1DModel(
sample_size=sample_size,
in_channels=num_channels,
out_channels=num_channels,
)

sample (torch.FloatTensor): (batch_size, sample_size, num_channels) noisy inputs tensor

sample = torch.randn(batch_size, sample_size, num_channels)
timestep = torch.zeros(batch_size, dtype=torch.int)
output = model(sample, timestep)

it gives me:
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias) 302 _single(0), self.dilation, self.groups) 303 return F.conv1d(input, weight, bias, self.stride, → 304 self.padding, self.dilation, self.groups) 305 306 def forward(self, input: Tensor) → Tensor:

RuntimeError: Given groups=1, weight of size [32, 1, 1], expected input[1, 144, 1] to have 1 channels, but got 144 channels instead

any help is appreciated
thanks

2 Likes