convnet-aig icon indicating copy to clipboard operation
convnet-aig copied to clipboard

ValueError: expected 2D or 3D input (got 4D input)

Open MrLinNing opened this issue 7 years ago • 2 comments

Hello Andreas Veit:

My PyTorch version is 4.0 , cuda is 9.0 and python is 3.5. I run the code, but I find this problem.

 python train.py

problem: image

I think the problem is ResNet110_cifar() function in convnet_aig.py file. I don't know how to fix the debug, can you help me? Thanks. @andreasveit

MrLinNing avatar Sep 27 '18 03:09 MrLinNing

This code is developed for Python 3.6.5 PyTorch 0.3.1 CUDA 9.1 Please test with that setup.

andreasveit avatar Sep 27 '18 12:09 andreasveit

For Pytorch 4.1, the batchnorm should be 2d instead of 1d.

Change here: https://github.com/andreasveit/convnet-aig/blob/master/convnet_aig.py#L80

irwinherrmann avatar Oct 23 '18 16:10 irwinherrmann