I got this error while trying to train a GAN model:
run(config)
File "t.py", line 417, in run
x, y = x.to(device), y.to(device)
AttributeError: 'tuple' object has no attribute 'to'
I got this error while trying to train a GAN model:
run(config)
File "t.py", line 417, in run
x, y = x.to(device), y.to(device)
AttributeError: 'tuple' object has no attribute 'to'
Based on the error message it seems that either one of the used objects (x
or y
) or both are a tuple instead of tensors.
Could you check the type and make sure the to()
operation is only called on tensors directly?