ctx=ctx)
File "O:\PycharmProjects\catdogtf2.2\venv\lib\site-packages\tensorflow\python\eager\execute.py", line 60, in quick_execute
inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.InternalError: Blas GEMM launch failed : a.shape=(32, 784), b.shape=(784, 416), m=32, n=416, k=784
[[node sequential/dense/MatMul (defined at O:\PycharmProjects\catdogtf2.2\venv\lib\site-packages\kerastuner\engine\multi_execution_tuner.py:96) ]] [Op:__inference_train_function_612]
Function call stack:
train_function
O:\PycharmProjects\catdogtf2.2\venv\Scripts\python.exe O:\PyCharm\plugins\python\helpers\pydev\pydevconsole.py --mode=client --port=55536
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
In[2]: runfile('O:/PycharmProjects/catdogtf2.2/007.py', wdir='O:/PycharmProjects/catdogtf2.2')
2020-08-11 05:34:45.873806: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
INFO:tensorflow:Reloading Oracle from existing project my_dir\intro_to_kt\oracle.json
2020-08-11 05:34:50.283008: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-08-11 05:34:50.339156: 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:34:50.339806: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:34:50.351520: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:34:50.359913: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:34:50.364738: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:34:50.374217: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:34:50.380346: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:34:50.413055: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:34:50.413370: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 05:34:50.413871: 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:34:50.427756: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1d956d60970 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:34:50.428254: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-08-11 05:34:50.428743: 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:34:50.429271: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-08-11 05:34:50.429544: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-08-11 05:34:50.429793: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-08-11 05:34:50.430049: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-08-11 05:34:50.430300: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-08-11 05:34:50.430560: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-08-11 05:34:50.430817: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-08-11 05:34:50.431157: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-08-11 05:34:51.313967: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-11 05:34:51.314219: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0
2020-08-11 05:34:51.314470: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N
2020-08-11 05:34:51.314864: 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:34:51.319706: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1d9802ad530 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-11 05:34:51.319979: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 2080 SUPER, Compute Capability 7.5
Epoch 1/2
2020-08-11 05:34:52.438439: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
1875/1875 [==============================] - 6s 3ms/step - loss: 0.6090 - accuracy: 0.7996 - val_loss: 0.4837 - val_accuracy: 0.8321
Epoch 2/2
1875/1875 [==============================] - 5s 3ms/step - loss: 0.4334 - accuracy: 0.8519 - val_loss: 0.4366 - val_accuracy: 0.8480
[Trial complete]
[Trial summary]
|-Trial ID: aaeeb7bcca2fc76db68c3ad3e310cecd
|-Score: 0.8479999899864197
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 416
Epoch 1/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.6126 - accuracy: 0.8012 - val_loss: 0.4814 - val_accuracy: 0.8346
Epoch 2/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.4354 - accuracy: 0.8519 - val_loss: 0.4488 - val_accuracy: 0.8424
[Trial complete]
[Trial summary]
|-Trial ID: 12814fc7320f16f22710c9a8c269170e
|-Score: 0.8424000144004822
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 352
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5419 - accuracy: 0.8075 - val_loss: 0.5194 - val_accuracy: 0.8094
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4433 - accuracy: 0.8429 - val_loss: 0.5086 - val_accuracy: 0.8158
[Trial complete]
[Trial summary]
|-Trial ID: c4fff7531ca3a6969006c400938b85a1
|-Score: 0.8158000111579895
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 96
Epoch 1/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.5358 - accuracy: 0.8119 - val_loss: 0.6265 - val_accuracy: 0.8015
Epoch 2/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.4350 - accuracy: 0.8443 - val_loss: 0.4645 - val_accuracy: 0.8439
[Trial complete]
[Trial summary]
|-Trial ID: ec06e969cbb76d2fb1ad4f264391d014
|-Score: 0.8439000248908997
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 416
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5177 - accuracy: 0.8195 - val_loss: 0.4538 - val_accuracy: 0.8375
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3902 - accuracy: 0.8606 - val_loss: 0.4393 - val_accuracy: 0.8451
[Trial complete]
[Trial summary]
|-Trial ID: c42f239d4c723bcf0e7a03a6d08811da
|-Score: 0.8450999855995178
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 64
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5298 - accuracy: 0.8122 - val_loss: 0.5086 - val_accuracy: 0.8244
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4337 - accuracy: 0.8436 - val_loss: 0.4526 - val_accuracy: 0.8363
[Trial complete]
[Trial summary]
|-Trial ID: 95f9684bb63af658265fd9ff2ae1623a
|-Score: 0.8363000154495239
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 192
Epoch 1/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.5481 - accuracy: 0.8112 - val_loss: 0.4766 - val_accuracy: 0.8269
Epoch 2/2
1875/1875 [==============================] - 4s 2ms/step - loss: 0.4346 - accuracy: 0.8457 - val_loss: 0.4664 - val_accuracy: 0.8368
[Trial complete]
[Trial summary]
|-Trial ID: 5faf0d2eddbc67fb81570f53b9c9cf09
|-Score: 0.8367999792098999
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 448
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5613 - accuracy: 0.8004 - val_loss: 0.5258 - val_accuracy: 0.8135
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4710 - accuracy: 0.8332 - val_loss: 0.4863 - val_accuracy: 0.8204
[Trial complete]
[Trial summary]
|-Trial ID: 50758537cee209ba7ce1005d343d09da
|-Score: 0.8203999996185303
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 32
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5370 - accuracy: 0.8104 - val_loss: 0.4769 - val_accuracy: 0.8300
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4406 - accuracy: 0.8430 - val_loss: 0.4628 - val_accuracy: 0.8363
[Trial complete]
[Trial summary]
|-Trial ID: fa9f01ffb454aa479866752e810edbc1
|-Score: 0.8363000154495239
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 256
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4737 - accuracy: 0.8302 - val_loss: 0.4213 - val_accuracy: 0.8463
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3562 - accuracy: 0.8694 - val_loss: 0.3660 - val_accuracy: 0.8701
[Trial complete]
[Trial summary]
|-Trial ID: 4c4399268ccd2b7d62689f2e06de9e91
|-Score: 0.8701000213623047
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 384
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4978 - accuracy: 0.8265 - val_loss: 0.4572 - val_accuracy: 0.8358
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3791 - accuracy: 0.8635 - val_loss: 0.4036 - val_accuracy: 0.8550
[Trial complete]
[Trial summary]
|-Trial ID: ddb27855abe1d4b89719dd06610f0fa0
|-Score: 0.8550000190734863
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 128
Epoch 1/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.6642 - accuracy: 0.7836 - val_loss: 0.5190 - val_accuracy: 0.8224
Epoch 2/2
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4622 - accuracy: 0.8428 - val_loss: 0.4652 - val_accuracy: 0.8373
[Trial complete]
[Trial summary]
|-Trial ID: 5d91cbe4452612810982997a0a2a4b28
|-Score: 0.8373000025749207
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 2
|-tuner/epochs: 2
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 192
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4765 - accuracy: 0.8317 - val_loss: 0.4468 - val_accuracy: 0.8362
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3597 - accuracy: 0.8690 - val_loss: 0.3860 - val_accuracy: 0.8580
[Trial complete]
[Trial summary]
|-Trial ID: 3131589c4b900c107a9423455eeaff10
|-Score: 0.8579999804496765
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 4
|-tuner/initial_epoch: 2
|-tuner/round: 1
|-tuner/trial_id: 4c4399268ccd2b7d62689f2e06de9e91
|-units: 384
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4935 - accuracy: 0.8268 - val_loss: 0.4095 - val_accuracy: 0.8550
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3712 - accuracy: 0.8662 - val_loss: 0.3852 - val_accuracy: 0.8626
[Trial complete]
[Trial summary]
|-Trial ID: ceafb91456da418a31d16505cd2402e4
|-Score: 0.8626000285148621
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 4
|-tuner/initial_epoch: 2
|-tuner/round: 1
|-tuner/trial_id: ddb27855abe1d4b89719dd06610f0fa0
|-units: 128
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.6121 - accuracy: 0.7983 - val_loss: 0.4894 - val_accuracy: 0.8328
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4304 - accuracy: 0.8534 - val_loss: 0.4399 - val_accuracy: 0.8473
[Trial complete]
[Trial summary]
|-Trial ID: 0c04ed5138b9f602660b69378a623a2a
|-Score: 0.8472999930381775
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 2
|-tuner/epochs: 4
|-tuner/initial_epoch: 2
|-tuner/round: 1
|-tuner/trial_id: aaeeb7bcca2fc76db68c3ad3e310cecd
|-units: 416
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5186 - accuracy: 0.8202 - val_loss: 0.4477 - val_accuracy: 0.8440
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3938 - accuracy: 0.8603 - val_loss: 0.4160 - val_accuracy: 0.8508
[Trial complete]
[Trial summary]
|-Trial ID: d78890f285f61be834ced94336dafd4d
|-Score: 0.8507999777793884
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 4
|-tuner/initial_epoch: 2
|-tuner/round: 1
|-tuner/trial_id: c42f239d4c723bcf0e7a03a6d08811da
|-units: 64
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4951 - accuracy: 0.8264 - val_loss: 0.4453 - val_accuracy: 0.8354
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3694 - accuracy: 0.8663 - val_loss: 0.3749 - val_accuracy: 0.8632
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3337 - accuracy: 0.8773 - val_loss: 0.3648 - val_accuracy: 0.8698
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3088 - accuracy: 0.8860 - val_loss: 0.3688 - val_accuracy: 0.8678
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2924 - accuracy: 0.8916 - val_loss: 0.3695 - val_accuracy: 0.8634
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2780 - accuracy: 0.8967 - val_loss: 0.3497 - val_accuracy: 0.8787
[Trial complete]
[Trial summary]
|-Trial ID: dccb65692f7afb5fcc4b63a3b7bbaf1d
|-Score: 0.8787000179290771
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 10
|-tuner/initial_epoch: 4
|-tuner/round: 2
|-tuner/trial_id: ceafb91456da418a31d16505cd2402e4
|-units: 128
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4855 - accuracy: 0.8264 - val_loss: 0.4290 - val_accuracy: 0.8395
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3606 - accuracy: 0.8683 - val_loss: 0.3868 - val_accuracy: 0.8615
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3232 - accuracy: 0.8814 - val_loss: 0.3795 - val_accuracy: 0.8599
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3010 - accuracy: 0.8876 - val_loss: 0.3692 - val_accuracy: 0.8676
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2805 - accuracy: 0.8947 - val_loss: 0.3407 - val_accuracy: 0.8771
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2677 - accuracy: 0.8993 - val_loss: 0.3363 - val_accuracy: 0.8806
[Trial complete]
[Trial summary]
|-Trial ID: 722faad2bf2c23229d312728f586150f
|-Score: 0.8805999755859375
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 2
|-tuner/epochs: 10
|-tuner/initial_epoch: 4
|-tuner/round: 2
|-tuner/trial_id: 3131589c4b900c107a9423455eeaff10
|-units: 384
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4884 - accuracy: 0.8278 - val_loss: 0.4205 - val_accuracy: 0.8515
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3679 - accuracy: 0.8651 - val_loss: 0.3766 - val_accuracy: 0.8627
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3297 - accuracy: 0.8788 - val_loss: 0.3615 - val_accuracy: 0.8687
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3039 - accuracy: 0.8879 - val_loss: 0.3549 - val_accuracy: 0.8697
[Trial complete]
[Trial summary]
|-Trial ID: 8cef999a933a85c276bec9a56319c8c5
|-Score: 0.869700014591217
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 224
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4777 - accuracy: 0.8306 - val_loss: 0.4090 - val_accuracy: 0.8552
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3593 - accuracy: 0.8694 - val_loss: 0.3658 - val_accuracy: 0.8683
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3244 - accuracy: 0.8803 - val_loss: 0.3450 - val_accuracy: 0.8733
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3016 - accuracy: 0.8889 - val_loss: 0.3361 - val_accuracy: 0.8772
[Trial complete]
[Trial summary]
|-Trial ID: cbe62524be42f5d78bae019f08ceca2c
|-Score: 0.8772000074386597
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 416
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5410 - accuracy: 0.8098 - val_loss: 0.5298 - val_accuracy: 0.8120
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4354 - accuracy: 0.8451 - val_loss: 0.5052 - val_accuracy: 0.8351
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4108 - accuracy: 0.8530 - val_loss: 0.4673 - val_accuracy: 0.8400
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4032 - accuracy: 0.8559 - val_loss: 0.4690 - val_accuracy: 0.8374
[Trial complete]
[Trial summary]
|-Trial ID: 7af2991e92f13605318218c96306888a
|-Score: 0.8399999737739563
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 352
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.6267 - accuracy: 0.7936 - val_loss: 0.5030 - val_accuracy: 0.8281
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4430 - accuracy: 0.8476 - val_loss: 0.4615 - val_accuracy: 0.8394
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4012 - accuracy: 0.8622 - val_loss: 0.4195 - val_accuracy: 0.8545
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3775 - accuracy: 0.8685 - val_loss: 0.4026 - val_accuracy: 0.8601
[Trial complete]
[Trial summary]
|-Trial ID: 6154ceac2594f8d81d6a2eb16bcd0a7d
|-Score: 0.8600999712944031
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 288
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4829 - accuracy: 0.8287 - val_loss: 0.4142 - val_accuracy: 0.8501
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3640 - accuracy: 0.8681 - val_loss: 0.3878 - val_accuracy: 0.8580
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3262 - accuracy: 0.8790 - val_loss: 0.3577 - val_accuracy: 0.8677
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3033 - accuracy: 0.8886 - val_loss: 0.3413 - val_accuracy: 0.8765
[Trial complete]
[Trial summary]
|-Trial ID: c06517aade90662bc6193c1aa08cbbba
|-Score: 0.8765000104904175
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 256
Epoch 1/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5961 - accuracy: 0.8044 - val_loss: 0.4801 - val_accuracy: 0.8356
Epoch 2/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4256 - accuracy: 0.8543 - val_loss: 0.4295 - val_accuracy: 0.8484
Epoch 3/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3846 - accuracy: 0.8673 - val_loss: 0.4070 - val_accuracy: 0.8581
Epoch 4/4
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3592 - accuracy: 0.8752 - val_loss: 0.3905 - val_accuracy: 0.8607
[Trial complete]
[Trial summary]
|-Trial ID: f5cddcedf8442fdb6d564890dff92027
|-Score: 0.8607000112533569
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 1
|-tuner/epochs: 4
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 480
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4768 - accuracy: 0.8308 - val_loss: 0.4162 - val_accuracy: 0.8462
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3586 - accuracy: 0.8692 - val_loss: 0.3695 - val_accuracy: 0.8682
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3237 - accuracy: 0.8812 - val_loss: 0.3581 - val_accuracy: 0.8705
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2994 - accuracy: 0.8888 - val_loss: 0.4071 - val_accuracy: 0.8526
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2808 - accuracy: 0.8954 - val_loss: 0.3533 - val_accuracy: 0.8739
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2644 - accuracy: 0.9014 - val_loss: 0.3326 - val_accuracy: 0.8796
[Trial complete]
[Trial summary]
|-Trial ID: 08338fc947066bc24893e649b0b6f4d4
|-Score: 0.8795999884605408
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 1
|-tuner/epochs: 10
|-tuner/initial_epoch: 4
|-tuner/round: 1
|-tuner/trial_id: cbe62524be42f5d78bae019f08ceca2c
|-units: 416
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4837 - accuracy: 0.8290 - val_loss: 0.4841 - val_accuracy: 0.8230
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3628 - accuracy: 0.8684 - val_loss: 0.3854 - val_accuracy: 0.8594
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3270 - accuracy: 0.8798 - val_loss: 0.3702 - val_accuracy: 0.8718
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2999 - accuracy: 0.8888 - val_loss: 0.3448 - val_accuracy: 0.8793
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2845 - accuracy: 0.8945 - val_loss: 0.3497 - val_accuracy: 0.8722
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2705 - accuracy: 0.8989 - val_loss: 0.3287 - val_accuracy: 0.8816
[Trial complete]
[Trial summary]
|-Trial ID: 5ce94ce93658715d3479344b029cfe30
|-Score: 0.881600022315979
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 1
|-tuner/epochs: 10
|-tuner/initial_epoch: 4
|-tuner/round: 1
|-tuner/trial_id: c06517aade90662bc6193c1aa08cbbba
|-units: 256
Epoch 1/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.5468 - accuracy: 0.8072 - val_loss: 0.4499 - val_accuracy: 0.8389
Epoch 2/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4324 - accuracy: 0.8436 - val_loss: 0.4621 - val_accuracy: 0.8389
Epoch 3/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4125 - accuracy: 0.8515 - val_loss: 0.4438 - val_accuracy: 0.8486
Epoch 4/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3960 - accuracy: 0.8562 - val_loss: 0.4496 - val_accuracy: 0.8422
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3888 - accuracy: 0.8603 - val_loss: 0.4836 - val_accuracy: 0.8350
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3824 - accuracy: 0.8637 - val_loss: 0.4556 - val_accuracy: 0.8430
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3764 - accuracy: 0.8641 - val_loss: 0.4791 - val_accuracy: 0.8347
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3730 - accuracy: 0.8652 - val_loss: 0.4642 - val_accuracy: 0.8479
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3648 - accuracy: 0.8671 - val_loss: 0.4617 - val_accuracy: 0.8510
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3647 - accuracy: 0.8678 - val_loss: 0.4392 - val_accuracy: 0.8534
[Trial complete]
[Trial summary]
|-Trial ID: 383e951e645acdb9d8f48b64b88c1518
|-Score: 0.8533999919891357
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.01
|-tuner/bracket: 0
|-tuner/epochs: 10
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 320
Epoch 1/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.6824 - accuracy: 0.7817 - val_loss: 0.5233 - val_accuracy: 0.8219
Epoch 2/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.4649 - accuracy: 0.8431 - val_loss: 0.4741 - val_accuracy: 0.8342
Epoch 3/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.4211 - accuracy: 0.8552 - val_loss: 0.4367 - val_accuracy: 0.8494
Epoch 4/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3959 - accuracy: 0.8637 - val_loss: 0.4180 - val_accuracy: 0.8545
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3784 - accuracy: 0.8692 - val_loss: 0.4095 - val_accuracy: 0.8555
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3645 - accuracy: 0.8742 - val_loss: 0.3973 - val_accuracy: 0.8604
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3521 - accuracy: 0.8771 - val_loss: 0.3914 - val_accuracy: 0.8631
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3425 - accuracy: 0.8805 - val_loss: 0.3880 - val_accuracy: 0.8657
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3336 - accuracy: 0.8831 - val_loss: 0.3746 - val_accuracy: 0.8674
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3246 - accuracy: 0.8859 - val_loss: 0.3709 - val_accuracy: 0.8693
[Trial complete]
[Trial summary]
|-Trial ID: ad2dae77806d10ee1e9164e17739e588
|-Score: 0.8693000078201294
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.0001
|-tuner/bracket: 0
|-tuner/epochs: 10
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 160
Epoch 1/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4730 - accuracy: 0.8315 - val_loss: 0.4586 - val_accuracy: 0.8299
Epoch 2/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3602 - accuracy: 0.8669 - val_loss: 0.3750 - val_accuracy: 0.8652
Epoch 3/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3231 - accuracy: 0.8814 - val_loss: 0.3479 - val_accuracy: 0.8749
Epoch 4/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2984 - accuracy: 0.8890 - val_loss: 0.3415 - val_accuracy: 0.8781
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2796 - accuracy: 0.8958 - val_loss: 0.3658 - val_accuracy: 0.8727
Epoch 6/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2653 - accuracy: 0.9013 - val_loss: 0.3472 - val_accuracy: 0.8750
Epoch 7/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2520 - accuracy: 0.9063 - val_loss: 0.3212 - val_accuracy: 0.8845
Epoch 8/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2418 - accuracy: 0.9083 - val_loss: 0.3224 - val_accuracy: 0.8873
Epoch 9/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2325 - accuracy: 0.9137 - val_loss: 0.3241 - val_accuracy: 0.8874
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2216 - accuracy: 0.9172 - val_loss: 0.3340 - val_accuracy: 0.8868
[Trial complete]
[Trial summary]
|-Trial ID: 7dc5b8f48a0d9d9a593d4c8d8207e06b
|-Score: 0.8873999714851379
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 0
|-tuner/epochs: 10
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 448
Epoch 1/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4765 - accuracy: 0.8311 - val_loss: 0.4336 - val_accuracy: 0.8453
Epoch 2/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.3590 - accuracy: 0.8692 - val_loss: 0.4138 - val_accuracy: 0.8507
Epoch 3/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.3229 - accuracy: 0.8823 - val_loss: 0.3560 - val_accuracy: 0.8707
Epoch 4/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.3002 - accuracy: 0.8882 - val_loss: 0.3403 - val_accuracy: 0.8762
Epoch 5/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2795 - accuracy: 0.8967 - val_loss: 0.3331 - val_accuracy: 0.8806
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2651 - accuracy: 0.9011 - val_loss: 0.3328 - val_accuracy: 0.8820
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2540 - accuracy: 0.9050 - val_loss: 0.3346 - val_accuracy: 0.8813
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2439 - accuracy: 0.9084 - val_loss: 0.3258 - val_accuracy: 0.8838
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2343 - accuracy: 0.9124 - val_loss: 0.3196 - val_accuracy: 0.8863
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2243 - accuracy: 0.9163 - val_loss: 0.3269 - val_accuracy: 0.8862
[Trial complete]
[Trial summary]
|-Trial ID: 8bc6752e2d7d1387f1a20986f63026f3
|-Score: 0.8863000273704529
|-Best step: 0
> Hyperparameters:
|-learning_rate: 0.001
|-tuner/bracket: 0
|-tuner/epochs: 10
|-tuner/initial_epoch: 0
|-tuner/round: 0
|-units: 352
INFO:tensorflow:Oracle triggered exit
The hyperparameter search is complete. The optimal number of units in the first densely-connected
layer is 448 and the optimal learning rate for the optimizer
is 0.001.
Epoch 1/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.4745 - accuracy: 0.8312 - val_loss: 0.4404 - val_accuracy: 0.8445
Epoch 2/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3599 - accuracy: 0.8680 - val_loss: 0.3671 - val_accuracy: 0.8655
Epoch 3/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.3229 - accuracy: 0.8810 - val_loss: 0.3693 - val_accuracy: 0.8693
Epoch 4/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2989 - accuracy: 0.8895 - val_loss: 0.3565 - val_accuracy: 0.8695
Epoch 5/10
1875/1875 [==============================] - 4s 2ms/step - loss: 0.2814 - accuracy: 0.8961 - val_loss: 0.3458 - val_accuracy: 0.8747
Epoch 6/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2657 - accuracy: 0.9000 - val_loss: 0.3325 - val_accuracy: 0.8799
Epoch 7/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2531 - accuracy: 0.9050 - val_loss: 0.3556 - val_accuracy: 0.8699
Epoch 8/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2436 - accuracy: 0.9082 - val_loss: 0.3251 - val_accuracy: 0.8872
Epoch 9/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2322 - accuracy: 0.9125 - val_loss: 0.3169 - val_accuracy: 0.8910
Epoch 10/10
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2219 - accuracy: 0.9167 - val_loss: 0.3242 - val_accuracy: 0.8887
import tensorflow as tf
from tensorflow import keras
import IPython
#!pip install -q -U keras-tuner
import kerastuner as kt
(img_train, label_train), (img_test, label_test) = keras.datasets.fashion_mnist.load_data()
# Normalize pixel values between 0 and 1
img_train = img_train.astype('float32') / 255.0
img_test = img_test.astype('float32') / 255.0
def model_builder(hp):
model = keras.Sequential()
model.add(keras.layers.Flatten(input_shape=(28, 28)))
# Tune the number of units in the first Dense layer
# Choose an optimal value between 32-512
hp_units = hp.Int('units', min_value=32, max_value=512, step=32)
model.add(keras.layers.Dense(units=hp_units, activation='relu'))
model.add(keras.layers.Dense(10))
# Tune the learning rate for the optimizer
# Choose an optimal value from 0.01, 0.001, or 0.0001
hp_learning_rate = hp.Choice('learning_rate', values=[1e-2, 1e-3, 1e-4])
model.compile(optimizer=keras.optimizers.Adam(learning_rate=hp_learning_rate),
loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
return model
tuner = kt.Hyperband(model_builder,
objective='val_accuracy',
max_epochs=10,
factor=3,
directory='my_dir',
project_name='intro_to_kt')
class ClearTrainingOutput(tf.keras.callbacks.Callback):
def on_train_end(*args, **kwargs):
IPython.display.clear_output(wait=True)
tuner.search(img_train, label_train, epochs=10, validation_data=(img_test, label_test),
callbacks=[ClearTrainingOutput()])
# Get the optimal hyperparameters
best_hps = tuner.get_best_hyperparameters(num_trials=1)[0]
print(f"""
The hyperparameter search is complete. The optimal number of units in the first densely-connected
layer is {best_hps.get('units')} and the optimal learning rate for the optimizer
is {best_hps.get('learning_rate')}.
""")
# Build the model with the optimal hyperparameters and train it on the data
model = tuner.hypermodel.build(best_hps)
model.fit(img_train, label_train, epochs=10, validation_data=(img_test, label_test))
'3D world > AI Integration Engineer' 카테고리의 다른 글
tutorials 09 (0) | 2020.08.11 |
---|---|
tutorials 08 (0) | 2020.08.11 |
tutorials 06 (0) | 2020.08.11 |
tutorials 05 (0) | 2020.08.11 |
tutorials 04 (0) | 2020.08.11 |
최근댓글