amzn / convolutional-handwriting-gan

ScrabbleGAN: Semi-Supervised Varying Length Handwritten Text Generation (CVPR20)
https://www.amazon.science/publications/scrabblegan-semi-supervised-varying-length-handwritten-text-generation
MIT License
264 stars 55 forks source link

Problem: AssertionError: the height of conv must be 1 #17

Closed AhmedAl93 closed 3 years ago

AhmedAl93 commented 3 years ago

Hello,

When I tried to train on my custom dataset, I had this error: Traceback (most recent call last): File "train.py", line 85, in model.optimize_D_OCR() File "convolutional-handwriting-gan/models/ScrabbleGAN_baseModel.py", line 392, in optimize_D_OCR self.backward_D_OCR() File "convolutional-handwriting-gan/models/ScrabbleGAN_baseModel.py", line 284, in backward_D_OCR self.pred_real_OCR = self.netOCR(self.real.detach()) File "miniconda3/envs/scrabblegan/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "convolutional-handwriting-gan/models/OCR_network.py", line 100, in forward assert h == 1, "the height of conv must be 1" AssertionError: the height of conv must be 1

Do you have any idea how it can be solved ? Thank you !

AhmedAl93 commented 3 years ago

The solution was to use "preprocess" argument, I set it to "resize_and_crop" and the issue was solved !