Skip to content

Instantly share code, notes, and snippets.

@spk921
Created December 29, 2016 03:56
Show Gist options
  • Save spk921/65dce2bc86c8470f388187c6169517a7 to your computer and use it in GitHub Desktop.
Save spk921/65dce2bc86c8470f388187c6169517a7 to your computer and use it in GitHub Desktop.
TensorFlow version check
python -c 'import tensorflow as tf; print(tf.__version__)' # for Python 2
python3 -c 'import tensorflow as tf; print(tf.__version__)' # for Python 3
@ssa21
Copy link

ssa21 commented Mar 26, 2018

Try
python -c "import tensorflow as tf; print(tf.VERSION)"

or

import tensorflow as tf
tf.VERSION

@TethysSun
Copy link

TethysSun commented Apr 6, 2018

I tried
python3 -c "import tensorflow as tf; print(tf.VERSION)"
python3 -c "import tensorflow as tf; print(tf.version)"
python3 -c "import tensorflow as tf; print(tf.__version__)"

Errors showed up:
AttributeError: module 'tensorflow' has no attribute 'VERSION'
or
AttributeError: module 'tensorflow' has no attribute '__version__'

and I also tried this
pip list | grep tensorflow

which didn't work too.
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

Any idea? BTW, I built it from source.

@poethan
Copy link

poethan commented May 21, 2020

Hi all, I got similar problem here.
from tensorflow.contrib.slim import parallel_reader, tfexample_decoder
ModuleNotFoundError: No module named 'tensorflow.contrib'

if Tensorflow.contrib does not exist anymore in the Colab, can I change the code " from tensorflow.contrib.slim import parallel_reader, tfexample_decoder" into any other wording to achieve the function please?
Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment