Advertisement
Guest User

Untitled

a guest
Jun 30th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. Python 3.5.2 (default, Nov 12 2018, 13:43:14)
  2. [GCC 5.4.0 20160609] on linux
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> import tensorflow as tf
  5. >>> from __future__ import absolute_import, division, print_function, unicode_literals
  6. >>> mnist = tf.keras.datasets.mnist
  7. >>>
  8. ... (x_train, y_train), (x_test, y_test) = mnist.load_data()
  9. Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
  10. 11493376/11490434 [==============================] - 0s 0us/step
  11. >>> x_train, x_test = x_train / 255.0, x_test / 255.0
  12. >>>
  13. ... model = tf.keras.models.Sequential([
  14. ... tf.keras.layers.Flatten(input_shape=(28, 28)),
  15. ... tf.keras.layers.Dense(128, activation='relu'),
  16. ... tf.keras.layers.Dropout(0.2),
  17. ... tf.keras.layers.Dense(10, activation='softmax')
  18. ... ])
  19. 2019-06-30 09:04:24.329777: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libhip_hcc.so
  20. 2019-06-30 09:04:24.372718: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1651] Found device 0 with properties:
  21. name: Device 67ef
  22. AMDGPU ISA: gfx803
  23. memoryClockRate (GHz) 1.196
  24. pciBusID 0000:01:00.0
  25. 2019-06-30 09:04:24.496828: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
  26. 2019-06-30 09:04:24.903751: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libMIOpen.so
  27. 2019-06-30 09:04:24.933368: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocfft.so
  28. 2019-06-30 09:04:24.946399: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocrand.so
  29. 2019-06-30 09:04:24.946599: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
  30. 2019-06-30 09:04:24.955333: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3593270000 Hz
  31. 2019-06-30 09:04:24.955908: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x46098f0 executing computations on platform Host. Devices:
  32. 2019-06-30 09:04:24.955935: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): <undefined>, <undefined>
  33. 2019-06-30 09:04:24.958578: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x468d1e0 executing computations on platform ROCM. Devices:
  34. 2019-06-30 09:04:24.958597: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Device 67ef, AMDGPU ISA version: gfx803
  35. 2019-06-30 09:04:24.973775: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1651] Found device 0 with properties:
  36. name: Device 67ef
  37. AMDGPU ISA: gfx803
  38. memoryClockRate (GHz) 1.196
  39. pciBusID 0000:01:00.0
  40. 2019-06-30 09:04:24.973862: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
  41. 2019-06-30 09:04:24.973874: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libMIOpen.so
  42. 2019-06-30 09:04:24.973883: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocfft.so
  43. 2019-06-30 09:04:24.973890: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocrand.so
  44. 2019-06-30 09:04:24.973933: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
  45. 2019-06-30 09:04:24.973961: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
  46. 2019-06-30 09:04:24.973971: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
  47. 2019-06-30 09:04:24.973977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
  48. 2019-06-30 09:04:24.974087: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3540 MB memory) -> physical GPU (device: 0, name: Device 67ef, pci bus id: 0000:01:00.0)
  49. >>>
  50. ... model.compile(optimizer='adam',
  51. ... loss='sparse_categorical_crossentropy',
  52. ... metrics=['accuracy'])
  53. >>>
  54. ... model.fit(x_train, y_train, epochs=5)
  55. WARNING: Logging before flag parsing goes to stderr.
  56. W0630 09:04:34.737572 140334190515968 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.
  57. Instructions for updating:
  58. Use tf.where in 2.0, which has the same broadcast rule as np.where
  59. Train on 60000 samples
  60. Epoch 1/5
  61. 2019-06-30 09:04:35.097500: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
  62. 60000/60000 [==============================] - 12s 193us/sample - loss: 1.0352 - accuracy: 0.6528
  63. Epoch 2/5
  64. 60000/60000 [==============================] - 8s 139us/sample - loss: 0.6836 - accuracy: 0.7788
  65. Epoch 3/5
  66. 60000/60000 [==============================] - 8s 139us/sample - loss: 0.6027 - accuracy: 0.8047
  67. Epoch 4/5
  68. 60000/60000 [==============================] - 8s 139us/sample - loss: 0.5781 - accuracy: 0.8144
  69. Epoch 5/5
  70. 60000/60000 [==============================] - 8s 139us/sample - loss: 0.5842 - accuracy: 0.8102
  71. <tensorflow.python.keras.callbacks.History object at 0x7fa1dbc67a58>
  72. >>>
  73. ... model.evaluate(x_test, y_test)
  74. 10000/10000 [==============================] - 1s 71us/sample - loss: 0.4284 - accuracy: 0.8751
  75. [0.4283891371488571, 0.8751]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement