Cast a Tensor to another Type in TensorFlow

We can cast a Tensor to another type in tensorflow as below: Cast a Tensor to another Type in TensorFlow Code as below: import tensorflow as tf # Create a TensorFlow float type Tensor x x = tf.constant([1.8, 2.2], dtype=tf.float32) # Cast a Tensor of float type to int Type in TensorFlow x = tf.dtypes.cast(x, … Continue reading Cast a Tensor to another Type in TensorFlow

How to check current version of TensorFlow?

To check current version of TensorFlow... use the below commands import tensorflow as tf tf.__version__ check current version of TensorFlow Cheers!! Logistic Regression Machine Learning Algorithm from Scratch in Python https://youtu.be/2ztuQKtW7So Logistic Regression Machine Learning Algorithm from Scratch in Python Gradient Descent Machine Learning Algorithm from Scratch in Python https://youtu.be/gurGhGPg-6s Gradient Descent Machine Learning Algorithm … Continue reading How to check current version of TensorFlow?

AttributeError: module tensorflow has no attribute placeholder TensorFlow 2.0

This error may come if you have installed TensorFlow 2.0 and want to run code that is not compatible with TensorFlow 2.0 You may like to watch a video on Neural Network from Scratch in Python https://www.youtube.com/watch?v=6bULlN2dUCo For example if you are trying to run below code, you will get the above error. x = … Continue reading AttributeError: module tensorflow has no attribute placeholder TensorFlow 2.0