Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 3.5.2 (default, Nov 12 2018, 13:43:14)
- [GCC 5.4.0 20160609] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import tensorflow as tf
- >>> from __future__ import absolute_import, division, print_function, unicode_literals
- >>> mnist = tf.keras.datasets.mnist
- >>>
- ... (x_train, y_train), (x_test, y_test) = mnist.load_data()
- Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
- 11493376/11490434 [==============================] - 0s 0us/step
- >>> x_train, x_test = x_train / 255.0, x_test / 255.0
- >>>
- ... model = tf.keras.models.Sequential([
- ... tf.keras.layers.Flatten(input_shape=(28, 28)),
- ... tf.keras.layers.Dense(128, activation='relu'),
- ... tf.keras.layers.Dropout(0.2),
- ... tf.keras.layers.Dense(10, activation='softmax')
- ... ])
- 2019-06-30 09:04:24.329777: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libhip_hcc.so
- 2019-06-30 09:04:24.372718: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1651] Found device 0 with properties:
- name: Device 67ef
- AMDGPU ISA: gfx803
- memoryClockRate (GHz) 1.196
- pciBusID 0000:01:00.0
- 2019-06-30 09:04:24.496828: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
- 2019-06-30 09:04:24.903751: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libMIOpen.so
- 2019-06-30 09:04:24.933368: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocfft.so
- 2019-06-30 09:04:24.946399: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocrand.so
- 2019-06-30 09:04:24.946599: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
- 2019-06-30 09:04:24.955333: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3593270000 Hz
- 2019-06-30 09:04:24.955908: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x46098f0 executing computations on platform Host. Devices:
- 2019-06-30 09:04:24.955935: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): <undefined>, <undefined>
- 2019-06-30 09:04:24.958578: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x468d1e0 executing computations on platform ROCM. Devices:
- 2019-06-30 09:04:24.958597: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Device 67ef, AMDGPU ISA version: gfx803
- 2019-06-30 09:04:24.973775: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1651] Found device 0 with properties:
- name: Device 67ef
- AMDGPU ISA: gfx803
- memoryClockRate (GHz) 1.196
- pciBusID 0000:01:00.0
- 2019-06-30 09:04:24.973862: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
- 2019-06-30 09:04:24.973874: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libMIOpen.so
- 2019-06-30 09:04:24.973883: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocfft.so
- 2019-06-30 09:04:24.973890: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocrand.so
- 2019-06-30 09:04:24.973933: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
- 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:
- 2019-06-30 09:04:24.973971: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
- 2019-06-30 09:04:24.973977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
- 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)
- >>>
- ... model.compile(optimizer='adam',
- ... loss='sparse_categorical_crossentropy',
- ... metrics=['accuracy'])
- >>>
- ... model.fit(x_train, y_train, epochs=5)
- WARNING: Logging before flag parsing goes to stderr.
- 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.
- Instructions for updating:
- Use tf.where in 2.0, which has the same broadcast rule as np.where
- Train on 60000 samples
- Epoch 1/5
- 2019-06-30 09:04:35.097500: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library librocblas.so
- 60000/60000 [==============================] - 12s 193us/sample - loss: 1.0352 - accuracy: 0.6528
- Epoch 2/5
- 60000/60000 [==============================] - 8s 139us/sample - loss: 0.6836 - accuracy: 0.7788
- Epoch 3/5
- 60000/60000 [==============================] - 8s 139us/sample - loss: 0.6027 - accuracy: 0.8047
- Epoch 4/5
- 60000/60000 [==============================] - 8s 139us/sample - loss: 0.5781 - accuracy: 0.8144
- Epoch 5/5
- 60000/60000 [==============================] - 8s 139us/sample - loss: 0.5842 - accuracy: 0.8102
- <tensorflow.python.keras.callbacks.History object at 0x7fa1dbc67a58>
- >>>
- ... model.evaluate(x_test, y_test)
- 10000/10000 [==============================] - 1s 71us/sample - loss: 0.4284 - accuracy: 0.8751
- [0.4283891371488571, 0.8751]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement