Octavian-ai / BigGAN-TPU-TensorFlow

TPU enabled Tensorflow implementation of "Large Scale GAN Training for High Fidelity Natural Image Synthesis" (BigGAN)
https://octavian.ai
MIT License
34 stars 13 forks source link

ProGan style TFRecord handling: Different types being fed to InfeedQueue #2

Closed AlLongley closed 5 years ago

AlLongley commented 5 years ago

The function parse_tfrecord_progan returns the parsed images as a tf.float32 however the labels are returned as an int64, this causes the ConcatV2 to complain of varying types

2019-10-03 06:27:54  tensorflow[2134] ERROR Error recorded from training_loop: Tensors in list passed to 'values' of 'ConcatV2' Op have types [**float32**, **int64**] that don't all match.

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("InfeedQueue/dequeue:1", shape=(256, 2), dtype=int64, device=/device:TPU_REPLICATED_CORE:0)'

Changing the dtype of the label to tf.float32 on the following line seems to fix the issue. Am I missing something here?

https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/blob/016980d08bdfe8317e1158711c59e886f388d3c5/input.py#L158

davidhughhenrymack commented 5 years ago

Odd, I swear this used to work fine :D Wanna pop a PR against it? Happy to merge

On October 2, 2019 at 11:42:02 PM, Ding Donger (notifications@github.com) wrote:

The function parse_tfrecord_progan returns the parsed images as a tf.float32 however the labels are returned as an int64, this causes the ConcatV2 to complain of varying types

2019-10-03 06:27:54 tensorflow[2134] ERROR Error recorded from training_loop: Tensors in list passed to 'values' of 'ConcatV2' Op have types [float32, int64] that don't all match.

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("InfeedQueue/dequeue:1", shape=(256, 2), dtype=int64, device=/device:TPU_REPLICATED_CORE:0)'

Changing the dtype of the label to tf.float32 on the following line seems to fix the issue. Am I missing something here?

https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/blob/016980d08bdfe8317e1158711c59e886f388d3c5/input.py#L158

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/issues/2?email_source=notifications&email_token=ADSQKIWVB6QU7KZ7R3HWE6DQMWH3TA5CNFSM4I47CNHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HPKD2EA, or mute the thread https://github.com/notifications/unsubscribe-auth/ADSQKIQMYRZBTDTWVALDVKDQMWH3TANCNFSM4I47CNHA .

AlLongley commented 5 years ago

Too easy!

https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/pull/3

I'm loving the results I'm getting out of this, btw. TPUs are a force to be reckoned with

davidhughhenrymack commented 5 years ago

Awesome! Thanks for the contribution :)

On October 4, 2019 at 6:06:30 AM, Al Longley (notifications@github.com) wrote:

Too easy!

3 https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/pull/3

I'm loving the results I'm getting out of this, btw. TPUs are a force to be reckoned with

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Octavian-ai/BigGAN-TPU-TensorFlow/issues/2?email_source=notifications&email_token=ADSQKIQWBJDKOCDYRGDOJYLQM45VLA5CNFSM4I47CNHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEALSSTA#issuecomment-538388812, or mute the thread https://github.com/notifications/unsubscribe-auth/ADSQKIUNPN5TETJFU62XNULQM45VLANCNFSM4I47CNHA .