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

error while training with GPUs #525

Open
buzhengbujiban opened this issue Apr 4, 2022 · 0 comments
Open

error while training with GPUs #525

buzhengbujiban opened this issue Apr 4, 2022 · 0 comments

Comments

@buzhengbujiban
Copy link

when I'm trying to set " num_gpus_per_job: 2 " in inpaint.yml and
rewrite something in the train.py:
discriminator_training_callback = ng.callbacks.SecondaryMultiGPUTrainer(
num_gpus=FLAGS.num_gpus_per_job,
pstep=1,
optimizer=d_optimizer,
var_list=d_vars,
max_iters=1,
grads_summary=False,
graph_def=multigpu_graph_def,
graph_def_kwargs={
'model': model, 'FLAGS': FLAGS, 'data': data, 'loss_type': 'd'},
)
# train generator with primary trainer
# trainer = ng.train.Trainer(
trainer = ng.train.MultiGPUTrainer(
num_gpus=FLAGS.num_gpus_per_job,
optimizer=g_optimizer,
var_list=g_vars,
max_iters=FLAGS.max_iters,
graph_def=multigpu_graph_def,
grads_summary=FLAGS.GRADS_SUMMARY,
gradient_processor=False,
graph_def_kwargs={
'model': model, 'FLAGS': FLAGS, 'data': data, 'loss_type': 'g'},
spe=FLAGS.train_spe,
log_dir=FLAGS.log_dir,

there is something wrong while training:

File "train.py", line 91, in
log_dir=FLAGS.log_dir,
File "/home/bo/anaconda3/envs/lwss/lib/python3.7/site-packages/neuralgym/train/multigpu_trainer.py", line 24, in init
self._train_op, self._loss = self.train_ops_and_losses()
File "/home/bo/anaconda3/envs/lwss/lib/python3.7/site-packages/neuralgym/train/multigpu_trainer.py", line 84, in train_ops_and_losses
grads = process_gradients(grads, gradient_processor)
File "/home/bo/anaconda3/envs/lwss/lib/python3.7/site-packages/neuralgym/ops/train_ops.py", line 46, in process_gradients
grads = [gradient_processor(grad) for grad in grads]
File "/home/bo/anaconda3/envs/lwss/lib/python3.7/site-packages/neuralgym/ops/train_ops.py", line 46, in
grads = [gradient_processor(grad) for grad in grads]
TypeError: 'bool' object is not callable

I am a beginner. If someone can tell me what went wrong, I will be very grateful
My tensorflow -- GPU version is 1.14.0

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

1 participant