Skip to content

Instantly share code, notes, and snippets.

@phisad
Last active January 18, 2019 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phisad/d5f93c438661656084bb686863ba576a to your computer and use it in GitHub Desktop.
Save phisad/d5f93c438661656084bb686863ba576a to your computer and use it in GitHub Desktop.
Tensorflow gpu starter (tensorflow-gpu 1.12 with CUDA 10.0)
import os
import tensorflow as tf;
# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def main():
tf.enable_eager_execution();
result = tf.reduce_sum(tf.random_normal([1000,1000]))
print(result)
print("Setup successful")
if __name__ == "__main__":
main()
@phisad
Copy link
Author

phisad commented Jan 18, 2019

We can disable the warning log level because the standard version is supposed to support as many CPU as possible, but we do not have to care when using tensorflow with gpu. All credits go to https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u

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