O:\PycharmProjects\catdogtf2.2\venv\Scripts\python.exe O:\PyCharm\plugins\python\helpers\pydev\pydevconsole.py --mode=client --port=61540
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['O:\\PycharmProjects\\catdogtf2.2', 'O:/PycharmProjects/catdogtf2.2'])
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 7.17.0
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] on win32
runfile('O:/PycharmProjects/catdogtf2.2/008.py', wdir='O:/PycharmProjects/catdogtf2.2')
2020-08-11 23:31:05.534081: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 23:31:10.139176: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-08-11 23:31:10.210855: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:09:00.0 name: GeForce RTX 2080 SUPER computeCapability: 7.5
coreClock: 1.845GHz coreCount: 48 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 462.00GiB/s
2020-08-11 23:31:10.211409: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 23:31:10.348189: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 23:31:10.468280: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 23:31:10.493316: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 23:31:10.595905: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 23:31:10.652508: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 23:31:10.838579: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 23:31:10.838907: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 23:31:10.842771: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-08-11 23:31:10.877618: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x217e0c4ae60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-11 23:31:10.877938: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-08-11 23:31:10.879107: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:09:00.0 name: GeForce RTX 2080 SUPER computeCapability: 7.5
coreClock: 1.845GHz coreCount: 48 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 462.00GiB/s
2020-08-11 23:31:10.879515: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 23:31:10.879707: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 23:31:10.879947: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 23:31:10.880133: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 23:31:10.880332: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 23:31:10.880536: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 23:31:10.880744: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 23:31:10.881010: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 23:31:13.480632: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-11 23:31:13.480840: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0
2020-08-11 23:31:13.480971: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N
2020-08-11 23:31:13.482523: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6198 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 SUPER, pci bus id: 0000:09:00.0, compute capability: 7.5)
2020-08-11 23:31:13.488531: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x217aceaba50 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-11 23:31:13.488852: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 2080 SUPER, Compute Capability 7.5
Epoch 1/10
2020-08-11 23:31:14.484151: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
938/938 [==============================] - 2s 2ms/step - loss: 3.1091 - sparse_categorical_accuracy: 0.8768
Epoch 2/10
938/938 [==============================] - 2s 2ms/step - loss: 0.4619 - sparse_categorical_accuracy: 0.9322
Epoch 3/10
938/938 [==============================] - 2s 2ms/step - loss: 0.3516 - sparse_categorical_accuracy: 0.9468
Epoch 4/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2997 - sparse_categorical_accuracy: 0.9552
Epoch 5/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2718 - sparse_categorical_accuracy: 0.9610
Epoch 6/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2567 - sparse_categorical_accuracy: 0.9646
Epoch 7/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2304 - sparse_categorical_accuracy: 0.9681
Epoch 8/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2215 - sparse_categorical_accuracy: 0.9702
Epoch 9/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2072 - sparse_categorical_accuracy: 0.9721
Epoch 10/10
938/938 [==============================] - 2s 2ms/step - loss: 0.2026 - sparse_categorical_accuracy: 0.9743
157/157 [==============================] - 0s 2ms/step - loss: 0.6995 - sparse_categorical_accuracy: 0.9564
import numpy as np
import tensorflow as tf
DATA_URL = 'https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz'
path = tf.keras.utils.get_file('mnist.npz', DATA_URL)
with np.load(path) as data:
train_examples = data['x_train']
train_labels = data['y_train']
test_examples = data['x_test']
test_labels = data['y_test']
train_dataset = tf.data.Dataset.from_tensor_slices((train_examples, train_labels))
test_dataset = tf.data.Dataset.from_tensor_slices((test_examples, test_labels))
BATCH_SIZE = 64
SHUFFLE_BUFFER_SIZE = 100
train_dataset = train_dataset.shuffle(SHUFFLE_BUFFER_SIZE).batch(BATCH_SIZE)
test_dataset = test_dataset.batch(BATCH_SIZE)
model = tf.keras.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(10)
])
model.compile(optimizer=tf.keras.optimizers.RMSprop(),
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['sparse_categorical_accuracy'])
model.fit(train_dataset, epochs=10)
model.evaluate(test_dataset)
'3D world > AI Integration Engineer' 카테고리의 다른 글
tutorials 10 (0) | 2020.08.11 |
---|---|
tutorials 09 (0) | 2020.08.11 |
tutorials 07 (0) | 2020.08.11 |
tutorials 06 (0) | 2020.08.11 |
tutorials 05 (0) | 2020.08.11 |
최근댓글