Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code errors #4

Open
Johnson-yue opened this issue Dec 17, 2018 · 4 comments
Open

Code errors #4

Johnson-yue opened this issue Dec 17, 2018 · 4 comments

Comments

@Johnson-yue
Copy link

Johnson-yue commented Dec 17, 2018

Hi, your data_loader.py have some bugs ,such as :

  1. in pretrain() function, data_loader should be return 7 element, but ImageFolder() only return 5 elements. I think , in pretrain() function, the data_loader should be EncoderFolder() not ImageFolder(), please check your code.

  2. In pretrain() function. self.E(src_img) should be return x_sout, x_cout, cls_style, cls_char, but your Encode() model return feature and None , so the bug at line 223 in solver.py. I think self.E should be Class ClassifierList not be Class EncoderList

@yongqyu
Copy link
Owner

yongqyu commented Dec 17, 2018

Thank you for your attention.

I modified the 145th line of manually data_loader.py for pre-train.

To reduce the memory usage, we have created a classifier class like Encoder. Classifier class should be used in pre-training, and Encoder class is used in main-training.
I apologize for the need for manual code modifications.

Thank you.

@Johnson-yue
Copy link
Author

oh.....you run the code twice.
First is for pre-training, and manually modified with EncoderFolder() in data_loader.py
Second is main-training, and use ImageFolder() and EncoderList replace EncoderFolder() and ClassifierList, is right?

@yongqyu
Copy link
Owner

yongqyu commented Dec 17, 2018

In pre-training,
dataloader : EncoderFolder()
Encoder : ClassifierList
In main-training,
dataloader : ImageFolder()
Encoder : EncoderList

it is right.

@Johnson-yue
Copy link
Author

Johnson-yue commented Dec 17, 2018

  1. load E model error, I think it should be :
    E_path = os.path.join(self.model_save_dir, '{}-E.ckpt'.format(self.enc_iters))

  2. I think your train dataset is very small,when I create my train dataset contain 20 typefaces and every typeface have 6763 characters,your progress() funtion is so slowly!!

  3. In Classifier() model, you used nn.Conv2d with kernel_size=32, it cost large GPU memory, when I change batch_size is 2, It is also out of memory in my GTX1080ti, 11GB
    Why do you using the so large kernel ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants