junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.2k stars 6.33k forks source link

how can I use 'continue_train' option? #87

Closed khryang closed 7 years ago

khryang commented 7 years ago

Hi~ I'm again, I want to train with the latest model of previous training. I used the commend flag "--continue_train" and others were same with previous training but the training epoch started at 1 epoch is there any more options to need?

junyanz commented 7 years ago

I just added the --epoch_count flag. By default, the program will initialize the epoch count as 1. Set --epoch_count to specify a different starting epoch count.

khryang commented 7 years ago

@junyanz thanks for your answer. where can I find the comment about 'epoch_count' in your code? I can't find it in the code of 'train_option' and 'base_option'

junyanz commented 7 years ago

It was recently added here.

khryang commented 7 years ago

@junyanz good! thank you!!

vin-ni commented 6 years ago

Hi, I tried to continue training like that: -dataroot ./datasets/opaGan --name opa_cyclegan --model cycle_gan --epoch_count 200 --continue_train but it just did the 200th epoch and then stopped. Is this the max training size or can I go up to epoch 400?

junyanz commented 6 years ago

It should stop at 200, as niter=200, niter_decay=200, and you start from epoch_count=200. If you want to train it longer, you can increase niter and/or niter_decay . See more details about these flags here.

skgshivam commented 4 years ago

It was recently added here.

I just added the --epoch_count flag. By default, the program will initialize the epoch count as 1. Set --epoch_count to specify a different starting epoch count.

Should I give --epoch_count value the last epoch at which training the model stopped along with --continue_train

junyanz commented 4 years ago

Yes.

Fai-yong commented 1 year ago

-dataroot ./datasets/opaGan --name opa_cyclegan --model cycle_gan --epoch_count 200 --continue_train

can I use this command to train a model base on a pre-trained model? or not? what does '--model cycle_gan' mean? using the pre-trained model in the path './checkpoint/cycle_gan' ?

I've got the official dataset from https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/ however, it needs a huge graphics memory to train (using the official dataset ), I have only a laptop with one RTX4060, how can I do some option to only train some of part of the whole network instead of training all of it?

If can, are there any suggestions about fine-tuning a pre-trained model? like adding some codes in certain places of the project, since I'm not an expert in using cycleGAN.