itayhubara / BinaryNet.pytorch

Binarized Neural Network (BNN) for pytorch
504 stars 125 forks source link

"input.size(1) != 3" and "if input.size(1) != 784" problem #28

Closed Aebestach closed 1 year ago

Aebestach commented 3 years ago

binarized_modules.py Hello, the author, I have some code in this document, I want to express anything else. input.size(1) != 784 in the binarizelinear class,input.size(1) != 3in the BinarizeConv2D class. What do they want to express?

itayhubara commented 3 years ago

You can't binarize the input image so if the size is 784 (for MNIST) or size(1)=3 for any RGB image (i.e. Cifar10 ImageNet) then you don't binarize the input.

Aebestach commented 3 years ago

@itayhubara Thank you, I understand.