-2

Image here The first block ran without any errors. but second says name error tf not defined even though i have imported tensorflow as tf.

tikendraw
  • 451
  • 3
  • 12

3 Answers3

2

Yes, simply

   import tensorflow as tf
   print(tf.__version__)

Additionally, check this is installed.

1
  1. Open the CMD in the administrator mode and install the libraries using pip install

  2. pip show to check the path where it is installed.

  3. Import the path using the following code:

import sys

sys.path.append('c:/users/admin/appdata/roaming/python/python39/site-packages') sys.path.append('c:/python/python39/lib/site-packages')

The path will vary as in step 2.

0

I would suggest rolling tensorflow back to a previous stable version, in this case. It might be a bug with the current version.