mustang-gan / mustang

9 stars 3 forks source link

AssertionError: Invalid tournament size: 2 #8

Open Zimuyeyi opened 3 years ago

Zimuyeyi commented 3 years ago

When I want to reproduce the experiment of applying mustangs to CelebA dataset in the paper, I use the configuration as same as the paper in celeba-2x2-smuganloss.yml as follows: trainer: name: lipizzaner_gan n_iterations: 20 calculate_net_weights_dist: True mixture_generator_samples_mode: exact_proportion params: population_size: 1 tournament_size: 2 n_replacements: 1 default_adam_learning_rate: 0.00005 alpha: 0.0001 mutation_probability: 0.5 discriminator_skip_each_nth_step: 0 mixture_sigma: 0.05 enable_selection: True score: enabled: True type: fid score_sample_size: 1000 cuda: True fitness: fitness_sample_size: 1000 fitness_mode: average dataloader: dataset_name: celeba use_batch: True batch_size: 128 n_batches: 0 shuffle: True network: name: convolutional loss: smuganloss master: calculate_score: True score_sample_size: 5000 cuda: True general: !include ../general-2x2.yml But when I start four clients and try to start the server, it shows: 2021-04-23 17:05:01,235 CRITICAL - distribution.client_api - An unhandled error occured while running Lipizzaner: Invalid tournament size: 2 Traceback (most recent call last): File "/home/lyc/GAN/mustang-master/mustang/src/distribution/client_api.py", line 166, in _run_lipizzaner lipizzaner.run(cc.settings['trainer']['n_iterations'], ClientAPI._stop_event) File "/home/lyc/GAN/mustang-master/mustang/src/lipizzaner.py", line 60, in run (generator, g_loss), (discriminator, d_loss) = self.trainer.train(n_iterations, stop_event) File "/home/lyc/GAN/mustang-master/mustang/src/training/ea/lipizzaner_gan_trainer.py", line 130, in train is_logging=True) File "/home/lyc/GAN/mustang-master/mustang/src/training/ea/ea_trainer.py", line 67, in tournament_selection new_population = Population(individuals=[], default_fitness=population.default_fitness, AssertionError: Invalid tournament size: 2 I want to know why this bug appear and how can I solve this error. Thanks!

Zimuyeyi commented 3 years ago

I notice that if I change the parameter population_size larger than 1, the code can run normally. But in the paper, it says Population size per cell is 1. Does this parameter corresponds to population_size?