import numpy as np
import tensorflow as tf
#!pip install -q tensorflow-hub
#!pip install -q tfds-nightly
import tensorflow_hub as hub
import tensorflow_datasets as tfds
print("버전: ", tf.__version__)
print("즉시 실행 모드: ", tf.executing_eagerly())
print("허브 버전: ", hub.__version__)
print("GPU", "사용 가능" if tf.config.experimental.list_physical_devices("GPU") else "NOT AVAILABLE")
# 훈련 세트를 6대 4로 나눕니다.
# 결국 훈련에 15,000개 샘플, 검증에 10,000개 샘플, 테스트에 25,000개 샘플을 사용하게 됩니다.
train_data, validation_data, test_data = tfds.load(
name="imdb_reviews",
split=('train[:60%]', 'train[60%:]', 'test'),
as_supervised=True)
train_examples_batch, train_labels_batch = next(iter(train_data.batch(10)))
train_examples_batch
train_labels_batch
embedding = "https://tfhub.dev/google/tf2-preview/gnews-swivel-20dim/1"
hub_layer = hub.KerasLayer(embedding, input_shape=[],
dtype=tf.string, trainable=True)
hub_layer(train_examples_batch[:3])
model = tf.keras.Sequential()
model.add(hub_layer)
model.add(tf.keras.layers.Dense(16, activation='relu'))
model.add(tf.keras.layers.Dense(1))
model.summary()
model.compile(optimizer='adam',
loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
metrics=['accuracy'])
history = model.fit(train_data.shuffle(10000).batch(512),
epochs=20,
validation_data=validation_data.batch(512),
verbose=1)
results = model.evaluate(test_data.batch(512), verbose=2)
for name, value in zip(model.metrics_names, results):
print("%s: %.3f" % (name, value))
#
# Copyright (c) 2017 François Chollet
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
O:\PycharmProjects\catdogtf2.2\venv\Scripts\python.exe O:\PyCharm\plugins\python\helpers\pydev\pydevconsole.py --mode=client --port=52110
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['O:\\PycharmProjects\\catdogtf2.2', 'O:/PycharmProjects/catdogtf2.2'])
PyDev console: starting.
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] on win32
>>> runfile('O:/PycharmProjects/catdogtf2.2/003.py', wdir='O:/PycharmProjects/catdogtf2.2')
2020-08-11 05:11:11.697892: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
버전: 2.2.0
즉시 실행 모드: True
허브 버전: 0.8.0
2020-08-11 05:11:14.939954: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-08-11 05:11:14.981186: 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 05:11:14.981690: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:11:14.987793: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:11:14.992555: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:11:14.995107: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:11:15.000251: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:11:15.003882: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:11:15.011752: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:11:15.012144: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
GPU 사용 가능
Downloading and preparing dataset imdb_reviews/plain_text/1.0.0 (download: Unknown size, generated: Unknown size, total: Unknown size) to C:\Users\joe\tensorflow_datasets\imdb_reviews\plain_text\1.0.0...
Dl Completed...: 0 url [00:00, ? url/s]
Dl Completed...: 0%| | 0/1 [00:00<?, ? url/s]
Dl Completed...: 0%| | 0/1 [00:00<?, ? url/s]
Dl Size...: 0%| | 0/80 [00:00<?, ? MiB/s]
Dl Completed...: 0%| | 0/1 [00:01<?, ? url/s]
Dl Size...: 1%|▏ | 1/80 [00:01<02:24, 1.83s/ MiB]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Size...: 2%|▎ | 2/80 [00:02<01:46, 1.37s/ MiB]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Size...: 4%|▍ | 3/80 [00:02<01:17, 1.00s/ MiB]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Size...: 6%|▋ | 5/80 [00:02<00:59, 1.25 MiB/s]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Size...: 8%|▊ | 6/80 [00:02<00:42, 1.73 MiB/s]
Dl Completed...: 0%| | 0/1 [00:02<?, ? url/s]
Dl Size...: 9%|▉ | 7/80 [00:02<00:32, 2.22 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 10%|█ | 8/80 [00:03<00:25, 2.79 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 11%|█▏ | 9/80 [00:03<00:20, 3.40 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 12%|█▎ | 10/80 [00:03<00:17, 4.01 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 14%|█▍ | 11/80 [00:03<00:15, 4.49 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 15%|█▌ | 12/80 [00:03<00:13, 5.05 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 16%|█▋ | 13/80 [00:03<00:12, 5.50 MiB/s]
Dl Completed...: 0%| | 0/1 [00:03<?, ? url/s]
Dl Size...: 18%|█▊ | 14/80 [00:03<00:11, 5.93 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 19%|█▉ | 15/80 [00:04<00:10, 6.35 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 20%|██ | 16/80 [00:04<00:09, 6.73 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 21%|██▏ | 17/80 [00:04<00:09, 6.86 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 22%|██▎ | 18/80 [00:04<00:08, 6.92 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 24%|██▍ | 19/80 [00:04<00:08, 7.09 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 25%|██▌ | 20/80 [00:04<00:08, 7.45 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 26%|██▋ | 21/80 [00:04<00:07, 7.50 MiB/s]
Dl Completed...: 0%| | 0/1 [00:04<?, ? url/s]
Dl Size...: 28%|██▊ | 22/80 [00:04<00:07, 7.63 MiB/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Size...: 29%|██▉ | 23/80 [00:05<00:07, 7.68 MiB/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Size...: 31%|███▏ | 25/80 [00:05<00:09, 5.57 MiB/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Size...: 32%|███▎ | 26/80 [00:05<00:08, 6.68 MiB/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Size...: 34%|███▍ | 27/80 [00:05<00:08, 6.32 MiB/s]
Dl Completed...: 0%| | 0/1 [00:05<?, ? url/s]
Dl Size...: 35%|███▌ | 28/80 [00:05<00:08, 6.24 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 36%|███▋ | 29/80 [00:06<00:08, 6.10 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 38%|███▊ | 30/80 [00:06<00:08, 6.10 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 39%|███▉ | 31/80 [00:06<00:07, 6.16 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 40%|████ | 32/80 [00:06<00:07, 6.08 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 41%|████▏ | 33/80 [00:06<00:07, 6.13 MiB/s]
Dl Completed...: 0%| | 0/1 [00:06<?, ? url/s]
Dl Size...: 42%|████▎ | 34/80 [00:06<00:07, 6.05 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 44%|████▍ | 35/80 [00:07<00:07, 6.17 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 45%|████▌ | 36/80 [00:07<00:06, 6.31 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 46%|████▋ | 37/80 [00:07<00:06, 6.33 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 48%|████▊ | 38/80 [00:07<00:06, 6.40 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 49%|████▉ | 39/80 [00:07<00:06, 6.39 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 50%|█████ | 40/80 [00:07<00:06, 6.46 MiB/s]
Dl Completed...: 0%| | 0/1 [00:07<?, ? url/s]
Dl Size...: 51%|█████▏ | 41/80 [00:07<00:06, 6.46 MiB/s]
Dl Completed...: 0%| | 0/1 [00:08<?, ? url/s]
Dl Size...: 52%|█████▎ | 42/80 [00:08<00:06, 5.74 MiB/s]
Dl Completed...: 0%| | 0/1 [00:08<?, ? url/s]
Dl Size...: 54%|█████▍ | 43/80 [00:08<00:06, 5.90 MiB/s]
Dl Completed...: 0%| | 0/1 [00:08<?, ? url/s]
Dl Size...: 55%|█████▌ | 44/80 [00:08<00:06, 5.45 MiB/s]
Dl Completed...: 0%| | 0/1 [00:08<?, ? url/s]
Dl Size...: 56%|█████▋ | 45/80 [00:08<00:06, 5.25 MiB/s]
Dl Completed...: 0%| | 0/1 [00:08<?, ? url/s]
Dl Size...: 57%|█████▊ | 46/80 [00:08<00:06, 5.14 MiB/s]
Dl Completed...: 0%| | 0/1 [00:09<?, ? url/s]
Dl Size...: 59%|█████▉ | 47/80 [00:09<00:06, 5.14 MiB/s]
Dl Completed...: 0%| | 0/1 [00:09<?, ? url/s]
Dl Size...: 60%|██████ | 48/80 [00:09<00:06, 5.13 MiB/s]
Dl Completed...: 0%| | 0/1 [00:09<?, ? url/s]
Dl Size...: 61%|██████▏ | 49/80 [00:09<00:06, 5.04 MiB/s]
Dl Completed...: 0%| | 0/1 [00:09<?, ? url/s]
Dl Size...: 62%|██████▎ | 50/80 [00:09<00:05, 5.08 MiB/s]
Dl Completed...: 0%| | 0/1 [00:09<?, ? url/s]
Dl Size...: 64%|██████▍ | 51/80 [00:09<00:05, 5.08 MiB/s]
Dl Completed...: 0%| | 0/1 [00:10<?, ? url/s]
Dl Size...: 65%|██████▌ | 52/80 [00:10<00:05, 5.16 MiB/s]
Dl Completed...: 0%| | 0/1 [00:10<?, ? url/s]
Dl Size...: 66%|██████▋ | 53/80 [00:10<00:05, 5.21 MiB/s]
Dl Completed...: 0%| | 0/1 [00:10<?, ? url/s]
Dl Size...: 68%|██████▊ | 54/80 [00:10<00:05, 5.20 MiB/s]
Dl Completed...: 0%| | 0/1 [00:10<?, ? url/s]
Dl Size...: 69%|██████▉ | 55/80 [00:10<00:04, 5.27 MiB/s]
Dl Completed...: 0%| | 0/1 [00:10<?, ? url/s]
Dl Size...: 70%|███████ | 56/80 [00:10<00:04, 5.25 MiB/s]
Dl Completed...: 0%| | 0/1 [00:11<?, ? url/s]
Dl Size...: 71%|███████▏ | 57/80 [00:11<00:04, 5.35 MiB/s]
Dl Completed...: 0%| | 0/1 [00:11<?, ? url/s]
Dl Size...: 72%|███████▎ | 58/80 [00:11<00:04, 4.59 MiB/s]
Dl Completed...: 0%| | 0/1 [00:11<?, ? url/s]
Dl Size...: 74%|███████▍ | 59/80 [00:11<00:03, 5.35 MiB/s]
Dl Completed...: 0%| | 0/1 [00:11<?, ? url/s]
Dl Size...: 75%|███████▌ | 60/80 [00:11<00:04, 4.47 MiB/s]
Dl Completed...: 0%| | 0/1 [00:12<?, ? url/s]
Dl Size...: 76%|███████▋ | 61/80 [00:12<00:04, 3.93 MiB/s]
Dl Completed...: 0%| | 0/1 [00:12<?, ? url/s]
Dl Size...: 78%|███████▊ | 62/80 [00:12<00:05, 3.47 MiB/s]
Dl Completed...: 0%| | 0/1 [00:12<?, ? url/s]
Dl Size...: 79%|███████▉ | 63/80 [00:12<00:05, 3.37 MiB/s]
Dl Completed...: 0%| | 0/1 [00:13<?, ? url/s]
Dl Size...: 80%|████████ | 64/80 [00:13<00:04, 3.26 MiB/s]
Dl Completed...: 0%| | 0/1 [00:13<?, ? url/s]
Dl Size...: 81%|████████▏ | 65/80 [00:13<00:04, 3.20 MiB/s]
Dl Completed...: 0%| | 0/1 [00:13<?, ? url/s]
Dl Size...: 82%|████████▎ | 66/80 [00:13<00:04, 3.22 MiB/s]
Dl Completed...: 0%| | 0/1 [00:14<?, ? url/s]
Dl Size...: 84%|████████▍ | 67/80 [00:14<00:04, 3.20 MiB/s]
Dl Completed...: 0%| | 0/1 [00:14<?, ? url/s]
Dl Size...: 85%|████████▌ | 68/80 [00:14<00:03, 3.14 MiB/s]
Dl Completed...: 0%| | 0/1 [00:14<?, ? url/s]
Dl Size...: 86%|████████▋ | 69/80 [00:14<00:03, 3.22 MiB/s]
Dl Completed...: 0%| | 0/1 [00:14<?, ? url/s]
Dl Size...: 88%|████████▊ | 70/80 [00:14<00:03, 3.28 MiB/s]
Dl Completed...: 0%| | 0/1 [00:15<?, ? url/s]
Dl Size...: 89%|████████▉ | 71/80 [00:15<00:02, 3.27 MiB/s]
Dl Completed...: 0%| | 0/1 [00:15<?, ? url/s]
Dl Size...: 90%|█████████ | 72/80 [00:15<00:02, 3.31 MiB/s]
Dl Completed...: 0%| | 0/1 [00:15<?, ? url/s]
Dl Size...: 91%|█████████▏| 73/80 [00:15<00:02, 3.23 MiB/s]
Dl Completed...: 0%| | 0/1 [00:16<?, ? url/s]
Dl Size...: 92%|█████████▎| 74/80 [00:16<00:01, 3.26 MiB/s]
Dl Completed...: 0%| | 0/1 [00:16<?, ? url/s]
Dl Size...: 94%|█████████▍| 75/80 [00:16<00:01, 3.33 MiB/s]
Dl Completed...: 0%| | 0/1 [00:16<?, ? url/s]
Dl Size...: 95%|█████████▌| 76/80 [00:16<00:01, 3.36 MiB/s]
Dl Completed...: 0%| | 0/1 [00:17<?, ? url/s]
Dl Size...: 96%|█████████▋| 77/80 [00:17<00:00, 3.33 MiB/s]
Dl Completed...: 0%| | 0/1 [00:17<?, ? url/s]
Dl Size...: 98%|█████████▊| 78/80 [00:17<00:00, 3.37 MiB/s]
Dl Completed...: 0%| | 0/1 [00:17<?, ? url/s]
Dl Size...: 99%|█████████▉| 79/80 [00:17<00:00, 3.22 MiB/s]
Dl Completed...: 0%| | 0/1 [00:17<?, ? url/s]
Dl Completed...: 100%|██████████| 1/1 [00:18<00:00, 18.17s/ url]
Dl Size...: 100%|██████████| 80/80 [00:18<00:00, 3.30 MiB/s]
Dl Size...: 100%|██████████| 80/80 [00:18<00:00, 4.40 MiB/s]
Dl Completed...: 100%|██████████| 1/1 [00:18<00:00, 18.19s/ url]
2020-08-11 05:12:33.707697: 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 05:12:33.717327: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2cfc5ef4840 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:12:33.717705: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-08-11 05:12:33.718160: 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 05:12:33.718695: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:12:33.718988: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:12:33.719280: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:12:33.719484: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:12:33.719627: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:12:33.719774: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:12:33.720091: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:12:33.720416: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 05:12:34.390731: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-11 05:12:34.391027: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0
2020-08-11 05:12:34.391187: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N
2020-08-11 05:12:34.391527: 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 05:12:34.395072: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2cfe70ccd90 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:12:34.395451: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 2080 SUPER, Compute Capability 7.5
2020-08-11 05:12:34.537614: W tensorflow/core/kernels/data/cache_dataset_ops.cc:794] The calling iterator did not fully read the dataset being cached. In order to avoid unexpected truncation of the dataset, the partially cached contents of the dataset will be discarded. This can happen if you have an input pipeline similar to `dataset.cache().take(k).repeat()`. You should use `dataset.take(k).cache().repeat()` instead.
O:\PycharmProjects\catdogtf2.2\venv\Scripts\python.exe O:\PyCharm\plugins\python\helpers\pydev\pydevconsole.py --mode=client --port=52502
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['O:\\PycharmProjects\\catdogtf2.2', 'O:/PycharmProjects/catdogtf2.2'])
PyDev console: starting.
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] on win32
>>> runfile('O:/PycharmProjects/catdogtf2.2/003.py', wdir='O:/PycharmProjects/catdogtf2.2')
2020-08-11 05:13:57.568884: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
버전: 2.2.0
즉시 실행 모드: True
허브 버전: 0.8.0
2020-08-11 05:14:00.879870: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-08-11 05:14:00.922800: 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 05:14:00.923333: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:14:00.930349: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:14:00.936246: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:14:00.939358: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:14:00.946195: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:14:00.950313: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:14:00.967528: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:14:00.967911: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
GPU 사용 가능
2020-08-11 05:14:00.973950: 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 05:14:00.984209: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2226ccff3e0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:14:00.984530: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-08-11 05:14:00.984990: 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 05:14:00.985551: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:14:00.985809: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:14:00.986154: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:14:00.986450: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:14:00.986694: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:14:00.986984: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:14:00.987291: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:14:00.987605: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 05:14:01.809327: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-11 05:14:01.809490: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0
2020-08-11 05:14:01.809577: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N
2020-08-11 05:14:01.810043: 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 05:14:01.815096: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2220f136b30 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:14:01.815298: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 2080 SUPER, Compute Capability 7.5
2020-08-11 05:14:02.005695: W tensorflow/core/kernels/data/cache_dataset_ops.cc:794] The calling iterator did not fully read the dataset being cached. In order to avoid unexpected truncation of the dataset, the partially cached contents of the dataset will be discarded. This can happen if you have an input pipeline similar to `dataset.cache().take(k).repeat()`. You should use `dataset.take(k).cache().repeat()` instead.
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
keras_layer (KerasLayer) (None, 20) 400020
_________________________________________________________________
dense (Dense) (None, 16) 336
_________________________________________________________________
dense_1 (Dense) (None, 1) 17
=================================================================
Total params: 400,373
Trainable params: 400,373
Non-trainable params: 0
_________________________________________________________________
Epoch 1/20
2020-08-11 05:14:05.483625: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 4 in the outer inference context.
2020-08-11 05:14:05.483920: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 3 in the outer inference context.
2020-08-11 05:14:05.484223: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 2 in the outer inference context.
2020-08-11 05:14:05.484393: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 1 in the outer inference context.
2020-08-11 05:14:05.661180: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 4 in the outer inference context.
2020-08-11 05:14:05.661578: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 3 in the outer inference context.
2020-08-11 05:14:05.661921: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 2 in the outer inference context.
2020-08-11 05:14:05.662296: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 1 in the outer inference context.
2020-08-11 05:14:05.862861: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
30/30 [==============================] - 2s 77ms/step - loss: 0.9824 - accuracy: 0.4959 - val_loss: 0.7466 - val_accuracy: 0.5309
Epoch 2/20
30/30 [==============================] - 2s 63ms/step - loss: 0.6758 - accuracy: 0.5873 - val_loss: 0.6331 - val_accuracy: 0.6114
Epoch 3/20
30/30 [==============================] - 2s 64ms/step - loss: 0.6032 - accuracy: 0.6542 - val_loss: 0.5875 - val_accuracy: 0.6675
Epoch 4/20
30/30 [==============================] - 2s 64ms/step - loss: 0.5615 - accuracy: 0.6960 - val_loss: 0.5546 - val_accuracy: 0.6944
Epoch 5/20
30/30 [==============================] - 2s 64ms/step - loss: 0.5261 - accuracy: 0.7221 - val_loss: 0.5262 - val_accuracy: 0.7258
Epoch 6/20
30/30 [==============================] - 2s 64ms/step - loss: 0.4938 - accuracy: 0.7515 - val_loss: 0.4988 - val_accuracy: 0.7450
Epoch 7/20
30/30 [==============================] - 2s 64ms/step - loss: 0.4632 - accuracy: 0.7757 - val_loss: 0.4738 - val_accuracy: 0.7636
Epoch 8/20
30/30 [==============================] - 2s 63ms/step - loss: 0.4335 - accuracy: 0.7958 - val_loss: 0.4511 - val_accuracy: 0.7811
Epoch 9/20
30/30 [==============================] - 2s 63ms/step - loss: 0.4051 - accuracy: 0.8124 - val_loss: 0.4291 - val_accuracy: 0.7933
Epoch 10/20
30/30 [==============================] - 2s 64ms/step - loss: 0.3793 - accuracy: 0.8265 - val_loss: 0.4112 - val_accuracy: 0.8127
Epoch 11/20
30/30 [==============================] - 2s 63ms/step - loss: 0.3532 - accuracy: 0.8447 - val_loss: 0.3921 - val_accuracy: 0.8124
Epoch 12/20
30/30 [==============================] - 2s 64ms/step - loss: 0.3298 - accuracy: 0.8587 - val_loss: 0.3778 - val_accuracy: 0.8323
Epoch 13/20
30/30 [==============================] - 2s 64ms/step - loss: 0.3074 - accuracy: 0.8713 - val_loss: 0.3630 - val_accuracy: 0.8384
Epoch 14/20
30/30 [==============================] - 2s 63ms/step - loss: 0.2867 - accuracy: 0.8837 - val_loss: 0.3511 - val_accuracy: 0.8370
Epoch 15/20
30/30 [==============================] - 2s 64ms/step - loss: 0.2676 - accuracy: 0.8936 - val_loss: 0.3404 - val_accuracy: 0.8460
Epoch 16/20
30/30 [==============================] - 2s 64ms/step - loss: 0.2502 - accuracy: 0.9006 - val_loss: 0.3318 - val_accuracy: 0.8513
Epoch 17/20
30/30 [==============================] - 2s 64ms/step - loss: 0.2345 - accuracy: 0.9081 - val_loss: 0.3253 - val_accuracy: 0.8579
Epoch 18/20
30/30 [==============================] - 2s 65ms/step - loss: 0.2197 - accuracy: 0.9150 - val_loss: 0.3219 - val_accuracy: 0.8656
Epoch 19/20
30/30 [==============================] - 2s 64ms/step - loss: 0.2057 - accuracy: 0.9225 - val_loss: 0.3145 - val_accuracy: 0.8608
Epoch 20/20
30/30 [==============================] - 2s 66ms/step - loss: 0.1934 - accuracy: 0.9298 - val_loss: 0.3126 - val_accuracy: 0.8656
49/49 - 2s - loss: 0.3249 - accuracy: 0.8554
loss: 0.325
accuracy: 0.855
원래 잘 되던게 다시 해보면, 한 번에 되는게 없네 ㅋ 믓튼, 자료 준비 잼남. tutorials 소스 요청은 mynameis@hajunho.com 으로 (은근 일임)
'3D world > AI Integration Engineer' 카테고리의 다른 글
tutorials 05 (0) | 2020.08.11 |
---|---|
tutorials 04 (0) | 2020.08.11 |
tutorials 02 (0) | 2020.08.11 |
tutorial 01 running on pyCharm 2020.2 & 3.7 (1) | 2020.08.11 |
Tensorflow, pytorch (0) | 2020.08.10 |
최근댓글