AntixK / PyTorch-VAE

A Collection of Variational Autoencoders (VAE) in PyTorch.
Apache License 2.0
6.48k stars 1.05k forks source link

Why the model can only train on size of [64, 64]? #99

Open ohhh-yang opened 1 month ago

ohhh-yang commented 1 month ago

When I try a size not equal to [64, 64], it comes below fault: File "/home/PyTorch-VAE/models/vanilla_vae.py", line 122, in forward mu, log_var = self.encode(input) File "/home/PyTorch-VAE/models/vanilla_vae.py", line 91, in encode mu = self.fc_mu(result) File "/home/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/home/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 94, in forward return F.linear(input, self.weight, self.bias) File "/home/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/functional.py", line 1753, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: mat1 dim 1 must match mat2 dim 0