Open SuperCarryFu opened 2 years ago
What should I do?
Hi. As I see, there is a problem with the input size of your images. You should use sizes compatible with the model architecture. I hope the problem has been solved.
The issue has been resolved, thank you for your reply
How did you solve this problem? I also encountered the same problem
The issue has been resolved, thank you for your reply
How did you solve this problem? I also encountered the same problem
Hi, @wowowowole . Please, provide your output from the console with the error
Traceback (most recent call last):
File "F:\sitepy\pycharm\AIGan-main\main.py", line 52, in
Process finished with exit code 1
The issue has been resolved, thank you for your reply
54/5000 Hello, I have the same problem when I directly use MNIST_target_model.pth, how do you solve it? Thank you!
@SuperCarryFu Could you tell me how you solve the problem ValueError: Expected more than 1 spatial element when training, got input size torch.Size([128, 32, 1, 1])
@Scintillare @SuperCarryFu Could you tell me how you solve the problem ValueError: Expected more than 1 spatial element when training, got input size torch.Size([128, 32, 1, 1]). I really want to known how to solve it for me as beginner. Thanks!
CUDA Available: True Traceback (most recent call last): File "E:/PythonCode/AIGan/main.py", line 52, in
aiGAN.train(dataloader, epochs)
File "E:\PythonCode\AIGan\AIGAN.py", line 284, in train
self.train_batch(images, labels)
File "E:\PythonCode\AIGan\AIGAN.py", line 165, in train_batch
d_real_logits, d_real_probs = self.netDisc(pgd_images)
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, kwargs)
File "E:\PythonCode\AIGan\models.py", line 77, in forward
output = self.model(x).squeeze()
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, *kwargs)
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\container.py", line 141, in forward
input = module(input)
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(input, kwargs)
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\instancenorm.py", line 57, in forward
return F.instance_norm(
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 2326, in instance_norm
_verify_spatial_size(input.size())
File "D:\Miniconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 2293, in _verify_spatial_size
raise ValueError("Expected more than 1 spatial element when training, got input size {}".format(size))
ValueError: Expected more than 1 spatial element when training, got input size torch.Size([128, 32, 1, 1])