Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [GCC 5.4.0 20160609] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> from __future__ import absolute_import, division, print_function, unicode_literals
- >>>
- ... import tensorflow as tf
- >>>
- ... 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:20:58.534954: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libhip_hcc.so
- 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
- 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
- 2019-06-30 09:20:58.565593: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3593270000 Hz
- 2019-06-30 09:20:58.566304: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x43e5ab0 executing computations on platform Host. Devices:
- 2019-06-30 09:20:58.566345: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): <undefined>, <undefined>
- 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
- 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
- >>>
- ... 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: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.
- 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: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.
- 60000/60000 [==============================] - 4s 75us/sample - loss: 0.2978 - accuracy: 0.9126
- Epoch 2/5
- 60000/60000 [==============================] - 4s 72us/sample - loss: 0.1408 - accuracy: 0.9578
- Epoch 3/5
- 60000/60000 [==============================] - 4s 72us/sample - loss: 0.1078 - accuracy: 0.9672
- Epoch 4/5
- 60000/60000 [==============================] - 4s 72us/sample - loss: 0.0869 - accuracy: 0.9725
- Epoch 5/5
- 60000/60000 [==============================] - 4s 72us/sample - loss: 0.0743 - accuracy: 0.9772
- <tensorflow.python.keras.callbacks.History object at 0x7fd0507aa978>
- >>>
- ... model.evaluate(x_test, y_test)
- 10000/10000 [==============================] - 0s 36us/sample - loss: 0.0764 - accuracy: 0.9756
- [0.0764070802133996, 0.9756]
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement