diff --git a/aimodel/src/rainfallwater_identity_TEST.ipynb b/aimodel/src/rainfallwater_identity_TEST.ipynb index d71aed5..acd3ba2 100644 --- a/aimodel/src/rainfallwater_identity_TEST.ipynb +++ b/aimodel/src/rainfallwater_identity_TEST.ipynb @@ -2,14 +2,24 @@ "cells": [ { "cell_type": "code", - "execution_count": 6, + "execution_count": 1, "id": "1f6fdebf-69c5-46ab-a5a8-f9c91f000ff3", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:04:42.075078: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:42.075095: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n" + ] + } + ], "source": [ "import os\n", "\n", "import tensorflow as tf\n", + "import matplotlib.pyplot as plt\n", "\n", "from lib.dataset.parse_heightmap import parse_heightmap\n", "from lib.ai.model_rainfallwater_mono import model_rainfallwater_mono\n", @@ -19,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 2, "id": "07093079", "metadata": {}, "outputs": [], @@ -33,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 3, "id": "f4466ac9", "metadata": {}, "outputs": [ @@ -42,8 +52,32 @@ "output_type": "stream", "text": [ "RAINFALL channels 1 width 64 height 64 HEIGHTMAP_INPUT False\n", - "convnext:shape IN x (None, 64, 64, 1)\n", - "DEBUG:convnext shape x (None, 64, 64, 1)\n", + "convnext:shape IN x (None, 64, 64, 1)\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:04:44.225064: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-01-05 20:04:44.225397: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225497: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublas.so.11'; dlerror: libcublas.so.11: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225576: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublasLt.so.11'; dlerror: libcublasLt.so.11: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225660: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcufft.so.10'; dlerror: libcufft.so.10: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225731: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcurand.so.10'; dlerror: libcurand.so.10: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225796: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusolver.so.11'; dlerror: libcusolver.so.11: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225861: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusparse.so.11'; dlerror: libcusparse.so.11: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225944: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudnn.so.8'; dlerror: libcudnn.so.8: cannot open shared object file: No such file or directory\n", + "2023-01-05 20:04:44.225961: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.\n", + "Skipping registering GPU devices...\n", + "2023-01-05 20:04:44.226508: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "DEBUG:model ENCODER output_shape (None, 512)\n", "DEBUG:model BOTTLENECK:stack2image output_shape (None, 4, 4, 512)\n" ] @@ -52,15 +86,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "2022-12-09 17:35:07.608 | WARNING | lib.ai.model_rainfallwater_mono:model_rainfallwater_mono:70 - Warning: TODO implement attention from https://ieeexplore.ieee.org/document/9076883\n", - "2022-12-09 17:35:07.656 | INFO | lib.ai.model_rainfallwater_mono:model_rainfallwater_mono:80 - learning_rate: None\n" + "2023-01-05 20:04:47.011 | WARNING | lib.ai.model_rainfallwater_mono:model_rainfallwater_mono:71 - Warning: TODO implement attention from https://ieeexplore.ieee.org/document/9076883\n", + "2023-01-05 20:04:47.054 | INFO | lib.ai.model_rainfallwater_mono:model_rainfallwater_mono:86 - learning_rate: 3e-05\n" ] } ], "source": [ "model = model_rainfallwater_mono(\n", "\tmetadata={ \"rainfallradar\": [ 1, 64, 64 ] },\n", - "\tmodel_arch_dec=\"convnext_i_xxtiny\"\n", + "\tmodel_arch_dec=\"convnext_i_xxtiny\",\n", + "\tlearning_rate=3e-5\n", ")\n", "\n", "summarywriter(model, filepath_output=os.path.join(dir_output, \"summary.txt\"))" @@ -68,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "id": "78c633e1", "metadata": {}, "outputs": [ @@ -76,22 +111,26 @@ "name": "stdout", "output_type": "stream", "text": [ - "cells 4096 cells/2 2048.0 shape+ (64, 64, 2) tf.Tensor(2401, shape=(), dtype=int64)\n" + "cells 4096 cells/2 2048.0 shape+ (64, 64) tf.Tensor(1015, shape=(), dtype=int64)\n" ] } ], "source": [ "heightmap = parse_heightmap(filepath_heightmap) / 100\n", "heightmap = tf.image.crop_to_bounding_box(tf.expand_dims(heightmap, axis=-1), 0, 0, 64, 64)\n", - "heightmap_labels = tf.one_hot(tf.cast(tf.math.greater(tf.squeeze(heightmap)/10, 0.05), dtype=tf.int32), 2)\n", + "#heightmap_labels = tf.one_hot(tf.cast(tf.math.greater(tf.squeeze(heightmap)/10, 0.05), dtype=tf.int32), 2)\n", + "heightmap_labels = tf.cast(tf.math.greater(tf.squeeze(heightmap)/10, 0.05), dtype=tf.int32)\n", "\n", - "dataset = tf.data.Dataset.from_tensor_slices([heightmap])\n", + "dataset = tf.data.Dataset.from_tensor_slices([heightmap_labels]).map(\n", + "\tlambda tensor: tf.expand_dims(tensor, axis=-1),\n", + "\tnum_parallel_calls=tf.data.AUTOTUNE\n", + ")\n", "dataset_labels = tf.data.Dataset.from_tensor_slices([heightmap_labels])\n", "\n", "for item in dataset_labels:\n", "\tprint(\"cells\", 64*64, \"cells/2\", (64*64)/2, \"shape+\", item.shape, tf.math.reduce_sum(tf.math.argmax(item, axis=-1)))\n", "\tbreak\n", - "dataset = tf.data.Dataset.zip((dataset_labels, dataset_labels)) \\\n", + "dataset = tf.data.Dataset.zip((dataset, dataset_labels)) \\\n", "\t.repeat(64 * 64) \\\n", "\t.batch(64) \\\n", "\t.prefetch(tf.data.AUTOTUNE)\n" @@ -99,7 +138,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "id": "3dbc95eb", "metadata": {}, "outputs": [ @@ -107,44 +146,517 @@ "name": "stdout", "output_type": "stream", "text": [ - "Epoch 1/50\n", - "WARNING:tensorflow:Model was constructed with shape (None, 64, 64, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 64, 64, 1), dtype=tf.float32, name='input_3'), name='input_3', description=\"created by layer 'input_3'\"), but it was called on an input with incompatible shape (None, 64, 64, 2).\n", - "WARNING:tensorflow:Model was constructed with shape (None, 64, 64, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 64, 64, 1), dtype=tf.float32, name='input_4'), name='input_4', description=\"created by layer 'input_4'\"), but it was called on an input with incompatible shape (None, 64, 64, 2).\n" + "Epoch 1/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0863 - binary_accuracy: 0.5702" ] }, { - "ename": "ValueError", - "evalue": "in user code:\n\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1051, in train_function *\n return step_function(self, iterator)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1040, in step_function **\n outputs = model.distribute_strategy.run(run_step, args=(data,))\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1030, in run_step **\n outputs = model.train_step(data)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 889, in train_step\n y_pred = self(x, training=True)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/utils/traceback_utils.py\", line 67, in error_handler\n raise e.with_traceback(filtered_tb) from None\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/input_spec.py\", line 248, in assert_input_compatibility\n raise ValueError(\n\n ValueError: Exception encountered when calling layer \"convnext1\" (type Functional).\n \n Input 0 of layer \"downsample_layers.0.0_conv\" is incompatible with the layer: expected axis -1 of input shape to have value 1, but received input with shape (None, 64, 64, 2)\n \n Call arguments received by layer \"convnext1\" (type Functional):\n • inputs=tf.Tensor(shape=(None, 64, 64, 2), dtype=float32)\n • training=True\n • mask=None\n", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [10], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m model\u001b[39m.\u001b[39mfit(\n\u001b[1;32m 2\u001b[0m \tdataset,\n\u001b[1;32m 3\u001b[0m \tepochs\u001b[39m=\u001b[39m\u001b[39m50\u001b[39m,\n\u001b[1;32m 4\u001b[0m \tcallbacks\u001b[39m=\u001b[39mmake_callbacks(\u001b[39m\"\u001b[39m\u001b[39m/tmp/x/mono_segment_TEST\u001b[39m\u001b[39m\"\u001b[39m, model)\n\u001b[1;32m 5\u001b[0m )\n", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/keras/utils/traceback_utils.py:67\u001b[0m, in \u001b[0;36mfilter_traceback..error_handler\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m e: \u001b[39m# pylint: disable=broad-except\u001b[39;00m\n\u001b[1;32m 66\u001b[0m filtered_tb \u001b[39m=\u001b[39m _process_traceback_frames(e\u001b[39m.\u001b[39m__traceback__)\n\u001b[0;32m---> 67\u001b[0m \u001b[39mraise\u001b[39;00m e\u001b[39m.\u001b[39mwith_traceback(filtered_tb) \u001b[39mfrom\u001b[39;00m \u001b[39mNone\u001b[39m\n\u001b[1;32m 68\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m \u001b[39mdel\u001b[39;00m filtered_tb\n", - "File \u001b[0;32m/tmp/__autograph_generated_filey37nprp8.py:15\u001b[0m, in \u001b[0;36mouter_factory..inner_factory..tf__train_function\u001b[0;34m(iterator)\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 14\u001b[0m do_return \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m\n\u001b[0;32m---> 15\u001b[0m retval_ \u001b[39m=\u001b[39m ag__\u001b[39m.\u001b[39mconverted_call(ag__\u001b[39m.\u001b[39mld(step_function), (ag__\u001b[39m.\u001b[39mld(\u001b[39mself\u001b[39m), ag__\u001b[39m.\u001b[39mld(iterator)), \u001b[39mNone\u001b[39;00m, fscope)\n\u001b[1;32m 16\u001b[0m \u001b[39mexcept\u001b[39;00m:\n\u001b[1;32m 17\u001b[0m do_return \u001b[39m=\u001b[39m \u001b[39mFalse\u001b[39;00m\n", - "\u001b[0;31mValueError\u001b[0m: in user code:\n\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1051, in train_function *\n return step_function(self, iterator)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1040, in step_function **\n outputs = model.distribute_strategy.run(run_step, args=(data,))\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 1030, in run_step **\n outputs = model.train_step(data)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/training.py\", line 889, in train_step\n y_pred = self(x, training=True)\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/utils/traceback_utils.py\", line 67, in error_handler\n raise e.with_traceback(filtered_tb) from None\n File \"/home/bryan-smithl/.local/lib/python3.10/site-packages/keras/engine/input_spec.py\", line 248, in assert_input_compatibility\n raise ValueError(\n\n ValueError: Exception encountered when calling layer \"convnext1\" (type Functional).\n \n Input 0 of layer \"downsample_layers.0.0_conv\" is incompatible with the layer: expected axis -1 of input shape to have value 1, but received input with shape (None, 64, 64, 2)\n \n Call arguments received by layer \"convnext1\" (type Functional):\n • inputs=tf.Tensor(shape=(None, 64, 64, 2), dtype=float32)\n • training=True\n • mask=None\n" + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:13:58.692 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:13:59.282 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 552s 8s/step - loss: 0.0863 - binary_accuracy: 0.5702\n", + "Epoch 2/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.1695 - binary_accuracy: 0.5977" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:22:53.006 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:22:53.575 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.1695 - binary_accuracy: 0.5977\n", + "Epoch 3/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.1154 - binary_accuracy: 0.5065" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:31:46.951 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:31:47.518 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.1154 - binary_accuracy: 0.5065\n", + "Epoch 4/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.2798 - binary_accuracy: 0.4606" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:40:40.765 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:40:41.338 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.2798 - binary_accuracy: 0.4606\n", + "Epoch 5/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0833 - binary_accuracy: 0.4692" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:49:34.870 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:49:35.429 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.0833 - binary_accuracy: 0.4692\n", + "Epoch 6/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0793 - binary_accuracy: 0.5488" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 20:58:26.682 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 20:58:27.245 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 532s 8s/step - loss: 0.0793 - binary_accuracy: 0.5488\n", + "Epoch 7/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0547 - binary_accuracy: 0.5568" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:07:17.933 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:07:18.495 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 531s 8s/step - loss: 0.0547 - binary_accuracy: 0.5568\n", + "Epoch 8/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0304 - binary_accuracy: 0.5615" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:16:09.952 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:16:10.519 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 532s 8s/step - loss: 0.0304 - binary_accuracy: 0.5615\n", + "Epoch 9/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0066 - binary_accuracy: 0.5657" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:25:03.040 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:25:03.614 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 533s 8s/step - loss: 0.0066 - binary_accuracy: 0.5657\n", + "Epoch 10/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0154 - binary_accuracy: 0.5707" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:33:57.583 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:33:58.155 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.0154 - binary_accuracy: 0.5707\n", + "Epoch 11/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0363 - binary_accuracy: 0.5749" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:42:52.326 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:42:52.898 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.0363 - binary_accuracy: 0.5749\n", + "Epoch 12/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0575 - binary_accuracy: 0.5775" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 21:51:46.051 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 21:51:46.627 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.0575 - binary_accuracy: 0.5775\n", + "Epoch 13/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0828 - binary_accuracy: 0.5835" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:00:40.405 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:00:40.971 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.0828 - binary_accuracy: 0.5835\n", + "Epoch 14/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.1216 - binary_accuracy: 0.5869" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:09:34.844 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:09:35.418 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.1216 - binary_accuracy: 0.5869\n", + "Epoch 15/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.1928 - binary_accuracy: 0.5821" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:18:28.651 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:18:29.219 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.1928 - binary_accuracy: 0.5821\n", + "Epoch 16/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.2815 - binary_accuracy: 0.5564" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:27:23.336 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:27:23.906 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.2815 - binary_accuracy: 0.5564\n", + "Epoch 17/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.2078 - binary_accuracy: 0.4880" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:36:18.191 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:36:18.761 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.2078 - binary_accuracy: 0.4880\n", + "Epoch 18/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.2591 - binary_accuracy: 0.4643" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:45:13.175 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:45:13.744 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.2591 - binary_accuracy: 0.4643\n", + "Epoch 19/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.4663 - binary_accuracy: 0.4370" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 22:54:08.037 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 22:54:08.624 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.4663 - binary_accuracy: 0.4370\n", + "Epoch 20/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0233 - binary_accuracy: 0.5323" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:03:03.088 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:03:03.655 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: 0.0233 - binary_accuracy: 0.5323\n", + "Epoch 21/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0272 - binary_accuracy: 0.5650" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:11:57.541 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:11:58.301 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: 0.0272 - binary_accuracy: 0.5650\n", + "Epoch 22/25\n", + "64/64 [==============================] - ETA: 0s - loss: 0.0047 - binary_accuracy: 0.5712" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:20:52.402 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:20:52.969 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: 0.0047 - binary_accuracy: 0.5712\n", + "Epoch 23/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0151 - binary_accuracy: 0.5776" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:29:46.982 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:29:47.558 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 535s 8s/step - loss: -0.0151 - binary_accuracy: 0.5776\n", + "Epoch 24/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0319 - binary_accuracy: 0.5800" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:38:40.377 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:38:40.948 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 533s 8s/step - loss: -0.0319 - binary_accuracy: 0.5800\n", + "Epoch 25/25\n", + "64/64 [==============================] - ETA: 0s - loss: -0.0465 - binary_accuracy: 0.5806" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-01-05 23:47:34.752 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:12 - Saving checkpoint\n", + "2023-01-05 23:47:35.313 | INFO | lib.ai.components.CallbackCustomModelCheckpoint:on_epoch_end:15 - Checkpoint saved successfully\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64/64 [==============================] - 534s 8s/step - loss: -0.0465 - binary_accuracy: 0.5806\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ "model.fit(\n", "\tdataset,\n", - "\tepochs=50,\n", + "\tepochs=25,\n", "\tcallbacks=make_callbacks(\"/tmp/x/mono_segment_TEST\", model)\n", ")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "b7f8c33f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1/1 [==============================] - 2s 2s/step\n", + "tf.Tensor(\n", + "[[[1 1 1 ... 1 1 1]\n", + " [1 1 1 ... 1 1 1]\n", + " [1 1 1 ... 1 1 1]\n", + " ...\n", + " [0 1 1 ... 1 1 1]\n", + " [1 1 1 ... 1 1 1]\n", + " [1 1 1 ... 1 1 1]]], shape=(1, 64, 64), dtype=int32)\n", + "tf.Tensor(3936, shape=(), dtype=int32) tf.Tensor(160, shape=(), dtype=int32)\n", + "(1, 64, 64)\n", + "[[[ 6.318168 4.484145 5.098278 ... 2.2153077 4.2120304\n", + " 3.6126046 ]\n", + " [ 6.4958954 5.6199083 6.5477724 ... 1.4242218 3.6372695\n", + " 4.750148 ]\n", + " [ 4.059501 3.8315465 7.3975286 ... 5.0964937 4.767578\n", + " 2.0836473 ]\n", + " ...\n", + " [-0.3680715 1.0862777 4.403977 ... 3.2975245 3.878313\n", + " 1.355243 ]\n", + " [ 7.1270704 3.7269826 4.1089396 ... 5.3976045 2.4421794\n", + " 2.3658426 ]\n", + " [ 6.693168 7.6807394 5.613674 ... 0.89391357 3.4751601\n", + " 3.142672 ]]]\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAGfCAYA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WeS7P2/OSBDaNiwYZo2bZoaGxsTyhsbG1VWVmapVulVXFwsv9+f0Obu7m41NTVlVZuNMVqyZIleeeUVvfnmmyouLk44nyvt7I0xRvF4PGfaeNttt6m1tVUtLS3OUVJSovnz56ulpUVjx47NiXZ+Xzwe10cffaTCwsKc+beUpJtuuqnH4xIHDx7UmDFjJFn8fzNtUx766dQU7d/97nfmwIEDprKy0owYMcJ88skntqvWZ7FYzLz//vvm/fffN5LM+vXrzfvvv+9MO1+zZo3xer3mlVdeMa2treaBBx7Iuqmgjz76qPF6vebtt99OmPL6zTffONfkQjurqqrM7t27TXt7u/nggw/MihUrzJAhQ0xDQ4MxJjfa2JvTZ8cZkxvt/MUvfmHefvttc/jwYfPOO++Yu+66y3g8HuezJhfaaMy30+zz8vLMs88+aw4dOmR+//vfm/z8fPPSSy8519ho64ANIWOM2bRpkxkzZowZNmyYmTp1qjPNN1u99dZbRlKPY8GCBcaYb6dIrlq1yvj9fuN2u80tt9xiWltb7VY6Sb21T5LZsmWLc00utPORRx5x7s3LLrvM3HbbbU4AGZMbbezN90MoF9p56lmYoUOHmkAgYObOnWv279/vnM+FNp7ypz/9yUycONG43W5z7bXXmrq6uoTzNtrKfkIAAGsG5HdCAIDBgRACAFhDCAEArCGEAADWEEIAAGsIIQCANYQQAMAaQggAYA0hBACwhhACAFhDCAEArPl/XJSicmb0BBsAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "prediction = model.predict(tf.expand_dims(heightmap, axis=0))\n", - "print(tf.math.argmax(prediction, axis=-1))\n", - "print(tf.math.reduce_sum(tf.math.argmax(prediction, axis=-1)))\n", - "print(prediction)\n" + "prediction_binarised = tf.cast(tf.math.greater(prediction, 0.5), dtype=tf.int32)\n", + "print(prediction_binarised)\n", + "print(tf.math.reduce_sum(prediction_binarised), (64*64) - tf.math.reduce_sum(prediction_binarised))\n", + "print(prediction_binarised.shape)\n", + "print(prediction)\n", + "plt.imshow(tf.squeeze(prediction_binarised))" ] } ],