简体   繁体   中英

Does it matter what dtype data is passed into a Tensorflow model for predictions?

So I have a TensorFlow model that I trained and it when I print the type of the data that I pass into the model to be trained, it is

<class 'tensorflow.python.data.ops.dataset_ops.MapDataset'>

Do I need to pass data of this same type into the model when I use .predict to make predictions from it or can I just pass it like a numpy array with the same dimensions?

This just tells you that you trained your model with a tf.data.Dataset .

You can predict using a regular numpy array or a tensor, as long as it has the same input shape as the data you used to train the model on!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM