AntreasAntoniou / DAGAN

DAGAN: Data Augmentation Generative Adversarial Networks
https://arxiv.org/abs/1711.04340
MIT License
415 stars 103 forks source link

ValueError: No variables to optimize #48

Open RichardChen123 opened 2 years ago

RichardChen123 commented 2 years ago

I'm trying to run the command given in the readme to train the DAGAN. At first, I had to fix some compatibility issues between tensorflow versions 1.x and 2.9.1 such as tf_slim instead of tf.contrib and using keras layers. It compiles now, but during runtime, I get the error "No variables to optimize" in the train() method of dagan_networks_wgan.py on the following line: opt_ops["g_opt_op"] = opts["g_opt"].minimize(losses["g_losses"], var_list=self.g.variables, colocate_gradients_with_ops=True)

It seems like there are no variables in the graph during the first time the train function is called? Has anyone gotten this to work in recent tensorflow versions?