Hello Dears Keras Developers and users
In the example given about the classification of structural data (Structured data classification from scratch in Code examples) on the web page of Keras, I want to get/see the contents of objects such as age_encoded or trestbps_encoded.
These objects are tensorflow.python.framework.ops.Tensor.
How can I get or view the contents of these tensors?
I googled very much, but could not find correct solution for doing it. I noticed that I can view the content of eager tensor, for example:
import tensorflow as tf
a = tf.constant([[1, 2], [3, 4]])
print(a)
tf.Tensor(
[[1 2]
[3 4]], shape=(2, 2), dtype=int32)
I can not get the contents of age_encoded:
print(age_encoded)
Tensor("normalization/truediv:0", shape=(None, 1), dtype=float32)
In
other words, can I convert tensorflow.python.framework.ops.Tensor to
tensorflow.python.framework.ops.EagerTensor and how to do it?
Specifications Tensorflow and Keras installed in Anaconda (ipython):
Keras: 2.3.0-tf
Tensorflow: 2.2.0
Specifications Tensorflow and Keras installed Pycharm:
Keras: 2.4.0
Tensorflow: 2.3.0
Please guide me.
I am waiting for your help.
Best regards.
Shahrokh
--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/43556053-8d41-4a50-8b97-b8f10b29c64an%40googlegroups.com.
Dear Lance
Thanks a lot for your guidance. Unfortunately I got another error after using the eval function.
I run the model provided in Keras until after the object of age_encoded, and then run the following commands and get error.
I found a solution in stackoverflow, but again I get error:
So I still can not see the contents of the tensor object.
Please guide me.
Best regards.
Shahrokh