handson-ml2 icon indicating copy to clipboard operation
handson-ml2 copied to clipboard

Casting X_batch to float32

Open DavidLandup0 opened this issue 3 years ago • 2 comments

Casting X_batch to float32 to avoid an InvalidArgumentError, caused by X_batch being of type uint8 instead of float32 in the tf.concat() operation, which should result in X_fake_and_real.

InvalidArgumentError: cannot compute ConcatV2 as input #1(zero-based) was expected to be a float tensor but is a uint8 tensor [Op:ConcatV2] name: concat

DavidLandup0 avatar Oct 04 '21 21:10 DavidLandup0

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Hi @DavidLandup0 , Thanks for the PR. However, I cannot reproduce the error you were getting. I just tried running the notebook on Colab (which currently uses TensorFlow 2.6.0) and the code worked fine, I didn't get any error (or even any warning) in this part of the notebook:

image

Can you reproduce the error? If so, could you please indicate which version of TF you are using? And perhaps provide a minimum code example that I can use to reproduce the problem?

Thanks again.

ageron avatar Oct 06 '21 05:10 ageron