Datatype conversion in tensorflow/python

假装没事ソ 提交于 2020-03-05 00:26:41

问题


Wokring on a cGAN as I have mentioned over the last few questions I posted.

The code lines giving me the error, which I think I have narrowed down perfectly is:

for images, labels in train_dataset:
            #gen_loss, disc_loss = train_step(images, labels)

The original Code for MNIST represents images as something like:

[-1.],
         [-1.],
         [-1.]],

        [[-1.],
         [-1.],
         [-1.],
         ...,
         [-1.],
         [-1.],
         [-1.]],

        [[-1.],
         [-1.],
         [-1.],
         ...,
         [-1.],
         [-1.],
         [-1.]]]], dtype=float32)>, <tf.Tensor: id=3685, shape=(200, 28, 28, 1), dtype=float32, numpy=
array([[[[-1.],
         [-1.],
         [-1.],
         ...,
         [-1.],
         [-1.],
         [-1.]],

My own code, when I run it under a few changes to prepare the dataset, and my images comes as a set of images

['..... .jpg' '..... .jpg' ..........]

Because of this, I am dealing with errors, I was hoping for help in transferring to the new data type?

来源:https://stackoverflow.com/questions/60238349/datatype-conversion-in-tensorflow-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!