SHARE
TWEET

Untitled

a guest Jun 30th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [GCC 5.4.0 20160609] on linux
  2. Type "help", "copyright", "credits" or "license" for more information.
  3. >>> from __future__ import absolute_import, division, print_function, unicode_literals
  4. >>>  
  5. ... import tensorflow as tf
  6. >>>  
  7. ... mnist = tf.keras.datasets.mnist
  8. >>>  
  9. ... (x_train, y_train), (x_test, y_test) = mnist.load_data()
  10. Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
  11. 11493376/11490434 [==============================] - 0s 0us/step
  12. >>> x_train, x_test = x_train / 255.0, x_test / 255.0
  13. >>>  
  14. ... model = tf.keras.models.Sequential([
  15. ...   tf.keras.layers.Flatten(input_shape=(28, 28)),
  16. ...   tf.keras.layers.Dense(128, activation='relu'),
  17. ...   tf.keras.layers.Dropout(0.2),
  18. ...   tf.keras.layers.Dense(10, activation='softmax')
  19. ... ])
  20. 2019-06-30 09:20:58.534954: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libhip_hcc.so
  21. 2019-06-30 09:20:58.538653: E tensorflow/stream_executor/rocm/rocm_driver.cc:996] could not retrieve ROCM device count: HIP_ERROR_NoDevice
  22. 2019-06-30 09:20:58.538699: E tensorflow/stream_executor/rocm/rocm_driver.cc:996] could not retrieve ROCM device count: HIP_ERROR_NoDevice
  23. 2019-06-30 09:20:58.565593: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3593270000 Hz
  24. 2019-06-30 09:20:58.566304: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x43e5ab0 executing computations on platform Host. Devices:
  25. 2019-06-30 09:20:58.566345: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
  26. 2019-06-30 09:20:58.568881: E tensorflow/stream_executor/rocm/rocm_driver.cc:996] could not retrieve ROCM device count: HIP_ERROR_NoDevice
  27. 2019-06-30 09:20:58.568919: E tensorflow/stream_executor/rocm/rocm_driver.cc:996] could not retrieve ROCM device count: HIP_ERROR_NoDevice
  28. >>>  
  29. ... model.compile(optimizer='adam',
  30. ...               loss='sparse_categorical_crossentropy',
  31. ...               metrics=['accuracy'])
  32. >>>  
  33. ... model.fit(x_train, y_train, epochs=5)
  34. WARNING: Logging before flag parsing goes to stderr.
  35. W0630 09:20:58.724037 140533716977408 deprecation.py:323] From /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
  36. Instructions for updating:
  37. Use tf.where in 2.0, which has the same broadcast rule as np.where
  38. Train on 60000 samples
  39. Epoch 1/5
  40. 2019-06-30 09:20:59.155986: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1483] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
  41. 60000/60000 [==============================] - 4s 75us/sample - loss: 0.2978 - accuracy: 0.9126
  42. Epoch 2/5
  43. 60000/60000 [==============================] - 4s 72us/sample - loss: 0.1408 - accuracy: 0.9578
  44. Epoch 3/5
  45. 60000/60000 [==============================] - 4s 72us/sample - loss: 0.1078 - accuracy: 0.9672
  46. Epoch 4/5
  47. 60000/60000 [==============================] - 4s 72us/sample - loss: 0.0869 - accuracy: 0.9725
  48. Epoch 5/5
  49. 60000/60000 [==============================] - 4s 72us/sample - loss: 0.0743 - accuracy: 0.9772
  50. <tensorflow.python.keras.callbacks.History object at 0x7fd0507aa978>
  51. >>>  
  52. ... model.evaluate(x_test, y_test)
  53. 10000/10000 [==============================] - 0s 36us/sample - loss: 0.0764 - accuracy: 0.9756
  54. [0.0764070802133996, 0.9756]
  55. >>>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top