{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "gpuType": "T4" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "accelerator": "GPU" }, "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "id": "as_4H1mDhLFC" }, "outputs": [], "source": [ "!cp /content/drive/MyDrive/computer_vision.zip /content/\n", "\n", "# Unzip\n", "!unzip -q /content/computer_vision.zip -d /content/" ] }, { "cell_type": "code", "source": [ "!ls /content/computer\\ vision/\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SCEUrWQMhj0t", "outputId": "ec9ee3ae-84d8-441b-8a85-8156eb4050d6" }, "execution_count": 2, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "app.py\tdata models outputs README.md requirements.txt src\n" ] } ] }, { "cell_type": "code", "source": [ "!python3 \"/content/computer vision/src/extract_features.py\"" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "K2PK6TtMi7Z0", "outputId": "33977dd5-7661-4391-f714-6d821921f389" }, "execution_count": 4, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "2026-04-07 23:31:50.856164: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", "E0000 00:00:1775604710.889407 8272 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", "E0000 00:00:1775604710.900458 8272 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", "W0000 00:00:1775604710.925422 8272 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775604710.925457 8272 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775604710.925464 8272 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775604710.925471 8272 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "2026-04-07 23:31:50.932253: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", "To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", "\n", "============================================================\n", " Extracting VGG16 features\n", "============================================================\n", "2026-04-07 23:31:58.332730: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:47] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n", "I0000 00:00:1775604718.334255 8272 gpu_device.cc:2019] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 13757 MB memory: -> device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5\n", "Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/vgg16/vgg16_weights_tf_dim_ordering_tf_kernels.h5\n", "\u001b[1m553467096/553467096\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m2s\u001b[0m 0us/step\n", "2026-04-07 23:32:02.987602: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 411041792 exceeds 10% of free system memory.\n", "2026-04-07 23:32:03.450495: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 67108864 exceeds 10% of free system memory.\n", "\n", "VGG16 feature extractor loaded\n", " Output shape: (None, 7, 7, 512) (spatial features)\n", "Extracting features for 8091 images...\n", "Extracting: 0% 0/8091 [00:00bf01, custom_call_target=\"__cudnn$convBiasActivationForward\", metadata={op_type=\"Conv2D\" op_name=\"functional_1/block4_conv1_1/convolution\" source_file=\"/usr/local/lib/python3.12/dist-packages/tensorflow/python/framework/ops.py\" source_line=1200}, backend_config={\"operation_queue_id\":\"0\",\"wait_on_operation_queues\":[],\"cudnn_conv_backend_config\":{\"conv_result_scale\":1,\"activation_mode\":\"kRelu\",\"side_input_scale\":0,\"leakyrelu_alpha\":0},\"force_earliest_schedule\":false}\n", "2026-04-07 23:32:06.169445: I external/local_xla/xla/service/gpu/autotuning/conv_algorithm_picker.cc:549] Omitted potentially buggy algorithm eng14{k25=2} for conv %cudnn-conv-bias-activation.47 = (f32[1,512,28,28]{3,2,1,0}, u8[0]{0}) custom-call(f32[1,512,28,28]{3,2,1,0} %bitcast.512, f32[512,512,3,3]{3,2,1,0} %bitcast.519, f32[512]{0} %bitcast.521), window={size=3x3 pad=1_1x1_1}, dim_labels=bf01_oi01->bf01, custom_call_target=\"__cudnn$convBiasActivationForward\", metadata={op_type=\"Conv2D\" op_name=\"functional_1/block4_conv2_1/convolution\" source_file=\"/usr/local/lib/python3.12/dist-packages/tensorflow/python/framework/ops.py\" source_line=1200}, backend_config={\"operation_queue_id\":\"0\",\"wait_on_operation_queues\":[],\"cudnn_conv_backend_config\":{\"conv_result_scale\":1,\"activation_mode\":\"kRelu\",\"side_input_scale\":0,\"leakyrelu_alpha\":0},\"force_earliest_schedule\":false}\n", "2026-04-07 23:32:06.307911: I external/local_xla/xla/service/gpu/autotuning/conv_algorithm_picker.cc:549] Omitted potentially buggy algorithm eng14{k25=2} for conv %cudnn-conv-bias-activation.49 = (f32[1,512,14,14]{3,2,1,0}, u8[0]{0}) custom-call(f32[1,512,14,14]{3,2,1,0} %bitcast.541, f32[512,512,3,3]{3,2,1,0} %bitcast.548, f32[512]{0} %bitcast.550), window={size=3x3 pad=1_1x1_1}, dim_labels=bf01_oi01->bf01, custom_call_target=\"__cudnn$convBiasActivationForward\", metadata={op_type=\"Conv2D\" op_name=\"functional_1/block5_conv1_1/convolution\" source_file=\"/usr/local/lib/python3.12/dist-packages/tensorflow/python/framework/ops.py\" source_line=1200}, backend_config={\"operation_queue_id\":\"0\",\"wait_on_operation_queues\":[],\"cudnn_conv_backend_config\":{\"conv_result_scale\":1,\"activation_mode\":\"kRelu\",\"side_input_scale\":0,\"leakyrelu_alpha\":0},\"force_earliest_schedule\":false}\n", "I0000 00:00:1775604726.888658 8324 device_compiler.h:188] Compiled cluster using XLA! This line is logged at most once for the lifetime of the process.\n", "Extracting: 100% 8091/8091 [12:32<00:00, 10.76it/s]\n", "Extracted features for 8091 images\n", "Features saved to: /content/computer vision/data/vgg16_features.pkl (774.9 MB)\n", "\n", "============================================================\n", " Extracting VGG19 features\n", "============================================================\n", "Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/vgg19/vgg19_weights_tf_dim_ordering_tf_kernels.h5\n", "\u001b[1m574710816/574710816\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m5s\u001b[0m 0us/step\n", "2026-04-07 23:44:47.428611: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 411041792 exceeds 10% of free system memory.\n", "2026-04-07 23:44:47.933276: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 67108864 exceeds 10% of free system memory.\n", "\n", "VGG19 feature extractor loaded\n", " Output shape: (None, 7, 7, 512) (spatial features)\n", "Extracting features for 8091 images...\n", "Extracting: 100% 8091/8091 [13:11<00:00, 10.22it/s]\n", "Extracted features for 8091 images\n", "Features saved to: /content/computer vision/data/vgg19_features.pkl (774.9 MB)\n", "\n", "✓ Feature extraction complete!\n" ] } ] }, { "cell_type": "code", "source": [ "!python3 \"/content/computer vision/src/train.py\" --backbone vgg16" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Nq-2hthWjOwT", "outputId": "af65bdce-3088-4f99-cc92-844bd3502a7f" }, "execution_count": 6, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "2026-04-08 00:08:11.956246: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", "E0000 00:00:1775606891.978990 146966 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", "E0000 00:00:1775606891.986034 146966 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", "W0000 00:00:1775606892.002800 146966 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775606892.002848 146966 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775606892.002852 146966 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775606892.002866 146966 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "2026-04-08 00:08:12.007976: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", "To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", "============================================================\n", " CaptionIQ — Training with VGG16\n", "============================================================\n", "\n", "Loading data...\n", " Vocabulary size: 7656\n", " Train images: 6000\n", " Val images: 1000\n", " Max caption length: 37\n", "\n", "Building model...\n", "2026-04-08 00:08:21.446157: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:47] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n", "I0000 00:00:1775606901.447651 146966 gpu_device.cc:2019] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 13757 MB memory: -> device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5\n", "\u001b[1mModel: \"CaptionIQ\"\u001b[0m\n", "┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mLayer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Param #\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mConnected to \u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩\n", "│ caption_input │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m) │ \u001b[32m0\u001b[0m │ - │\n", "│ (\u001b[94mInputLayer\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_embedding │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m, \u001b[32m256\u001b[0m) │ \u001b[32m1,959,936\u001b[0m │ caption_input[\u001b[32m0\u001b[0m]… │\n", "│ (\u001b[94mEmbedding\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_dropout │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m, \u001b[32m256\u001b[0m) │ \u001b[32m0\u001b[0m │ caption_embeddin… │\n", "│ (\u001b[94mDropout\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ not_equal │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m) │ \u001b[32m0\u001b[0m │ caption_input[\u001b[32m0\u001b[0m]… │\n", "│ (\u001b[94mNotEqual\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ image_input │ (\u001b[96mNone\u001b[0m, \u001b[32m49\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m0\u001b[0m │ - │\n", "│ (\u001b[94mInputLayer\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_lstm (\u001b[94mLSTM\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m1,574,912\u001b[0m │ caption_dropout[\u001b[32m…\u001b[0m │\n", "│ │ │ │ not_equal[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ attention │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m262,913\u001b[0m │ image_input[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m… │\n", "│ (\u001b[94mBahdanauAttention\u001b[0m) │ │ │ caption_lstm[\u001b[32m0\u001b[0m][\u001b[32m…\u001b[0m │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ merge (\u001b[94mConcatenate\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m1024\u001b[0m) │ \u001b[32m0\u001b[0m │ attention[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m], │\n", "│ │ │ │ caption_lstm[\u001b[32m0\u001b[0m][\u001b[32m…\u001b[0m │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ dense_relu (\u001b[94mDense\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m524,800\u001b[0m │ merge[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ dense_dropout │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m0\u001b[0m │ dense_relu[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "│ (\u001b[94mDropout\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ output (\u001b[94mDense\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m7656\u001b[0m) │ \u001b[32m3,927,528\u001b[0m │ dense_dropout[\u001b[32m0\u001b[0m]… │\n", "└─────────────────────┴───────────────────┴────────────┴───────────────────┘\n", "\u001b[1m Total params: \u001b[0m\u001b[32m8,250,089\u001b[0m (31.47 MB)\n", "\u001b[1m Trainable params: \u001b[0m\u001b[32m8,250,089\u001b[0m (31.47 MB)\n", "\u001b[1m Non-trainable params: \u001b[0m\u001b[32m0\u001b[0m (0.00 B)\n", " Train steps/epoch: 11051\n", " Val steps/epoch: 1816\n", "\n", "Training for 50 epochs...\n", "Epoch 1/50\n", "I0000 00:00:1775606908.438727 147026 cuda_dnn.cc:529] Loaded cuDNN version 91002\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 5.3842\n", "Epoch 1: val_loss improved from None to 4.49467, saving model to /content/computer vision/models/model_vgg16.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 1: finished saving model to /content/computer vision/models/model_vgg16.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m188s\u001b[0m 17ms/step - loss: 5.0973 - val_loss: 4.4947 - learning_rate: 0.0010\n", "Epoch 2/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.6810\n", "Epoch 2: val_loss improved from 4.49467 to 4.46008, saving model to /content/computer vision/models/model_vgg16.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 2: finished saving model to /content/computer vision/models/model_vgg16.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.6903 - val_loss: 4.4601 - learning_rate: 0.0010\n", "Epoch 3/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.6217\n", "Epoch 3: val_loss did not improve from 4.46008\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m182s\u001b[0m 16ms/step - loss: 4.6642 - val_loss: 4.5293 - learning_rate: 0.0010\n", "Epoch 4/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.6129\n", "Epoch 4: val_loss did not improve from 4.46008\n", "\n", "Epoch 4: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m203s\u001b[0m 18ms/step - loss: 4.6809 - val_loss: 4.6666 - learning_rate: 0.0010\n", "Epoch 5/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.5777\n", "Epoch 5: val_loss improved from 4.46008 to 4.41211, saving model to /content/computer vision/models/model_vgg16.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 5: finished saving model to /content/computer vision/models/model_vgg16.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m185s\u001b[0m 17ms/step - loss: 4.5544 - val_loss: 4.4121 - learning_rate: 5.0000e-04\n", "Epoch 6/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.4628\n", "Epoch 6: val_loss did not improve from 4.41211\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m182s\u001b[0m 16ms/step - loss: 4.4939 - val_loss: 4.5103 - learning_rate: 5.0000e-04\n", "Epoch 7/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.4421\n", "Epoch 7: val_loss did not improve from 4.41211\n", "\n", "Epoch 7: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m183s\u001b[0m 17ms/step - loss: 4.4728 - val_loss: 4.5142 - learning_rate: 5.0000e-04\n", "Epoch 8/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.3857\n", "Epoch 8: val_loss did not improve from 4.41211\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m182s\u001b[0m 16ms/step - loss: 4.3858 - val_loss: 4.4318 - learning_rate: 2.5000e-04\n", "Epoch 9/50\n", "\u001b[1m11048/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.3388\n", "Epoch 9: val_loss improved from 4.41211 to 4.38911, saving model to /content/computer vision/models/model_vgg16.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 9: finished saving model to /content/computer vision/models/model_vgg16.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m183s\u001b[0m 17ms/step - loss: 4.3401 - val_loss: 4.3891 - learning_rate: 2.5000e-04\n", "Epoch 10/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 4.2915\n", "Epoch 10: val_loss did not improve from 4.38911\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m184s\u001b[0m 17ms/step - loss: 4.3154 - val_loss: 4.3920 - learning_rate: 2.5000e-04\n", "Epoch 11/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2887\n", "Epoch 11: val_loss improved from 4.38911 to 4.38810, saving model to /content/computer vision/models/model_vgg16.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 11: finished saving model to /content/computer vision/models/model_vgg16.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m186s\u001b[0m 17ms/step - loss: 4.2976 - val_loss: 4.3881 - learning_rate: 2.5000e-04\n", "Epoch 12/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2819\n", "Epoch 12: val_loss did not improve from 4.38810\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.2877 - val_loss: 4.4457 - learning_rate: 2.5000e-04\n", "Epoch 13/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2826\n", "Epoch 13: val_loss did not improve from 4.38810\n", "\n", "Epoch 13: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.2827 - val_loss: 4.4544 - learning_rate: 2.5000e-04\n", "Epoch 14/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2194\n", "Epoch 14: val_loss did not improve from 4.38810\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m194s\u001b[0m 18ms/step - loss: 4.2126 - val_loss: 4.4763 - learning_rate: 1.2500e-04\n", "Epoch 15/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1832\n", "Epoch 15: val_loss did not improve from 4.38810\n", "\n", "Epoch 15: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m196s\u001b[0m 18ms/step - loss: 4.1867 - val_loss: 4.4698 - learning_rate: 1.2500e-04\n", "Epoch 16/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1447\n", "Epoch 16: val_loss did not improve from 4.38810\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m192s\u001b[0m 17ms/step - loss: 4.1490 - val_loss: 4.4708 - learning_rate: 6.2500e-05\n", "Epoch 16: early stopping\n", "Restoring model weights from the end of the best epoch: 11.\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Model saved to: /content/computer vision/models/model_vgg16.h5\n", "Loss plot saved to: /content/computer vision/outputs/loss_vgg16.png\n", "\n", "✓ Training complete!\n" ] } ] }, { "cell_type": "code", "source": [ "!python3 \"/content/computer vision/src/train.py\" --backbone vgg19\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Cc6_3oTlqcZA", "outputId": "12e18e9a-a802-40f1-b327-f4c130e8b89f" }, "execution_count": 7, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "2026-04-08 01:40:09.091223: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", "E0000 00:00:1775612409.113453 169919 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", "E0000 00:00:1775612409.120423 169919 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", "W0000 00:00:1775612409.137250 169919 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775612409.137293 169919 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775612409.137298 169919 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "W0000 00:00:1775612409.137301 169919 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n", "2026-04-08 01:40:09.141870: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", "To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", "============================================================\n", " CaptionIQ — Training with VGG19\n", "============================================================\n", "\n", "Loading data...\n", " Vocabulary size: 7656\n", " Train images: 6000\n", " Val images: 1000\n", " Max caption length: 37\n", "\n", "Building model...\n", "2026-04-08 01:40:18.516807: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:47] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n", "I0000 00:00:1775612418.518264 169919 gpu_device.cc:2019] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 13757 MB memory: -> device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5\n", "\u001b[1mModel: \"CaptionIQ\"\u001b[0m\n", "┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mLayer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Param #\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mConnected to \u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩\n", "│ caption_input │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m) │ \u001b[32m0\u001b[0m │ - │\n", "│ (\u001b[94mInputLayer\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_embedding │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m, \u001b[32m256\u001b[0m) │ \u001b[32m1,959,936\u001b[0m │ caption_input[\u001b[32m0\u001b[0m]… │\n", "│ (\u001b[94mEmbedding\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_dropout │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m, \u001b[32m256\u001b[0m) │ \u001b[32m0\u001b[0m │ caption_embeddin… │\n", "│ (\u001b[94mDropout\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ not_equal │ (\u001b[96mNone\u001b[0m, \u001b[32m37\u001b[0m) │ \u001b[32m0\u001b[0m │ caption_input[\u001b[32m0\u001b[0m]… │\n", "│ (\u001b[94mNotEqual\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ image_input │ (\u001b[96mNone\u001b[0m, \u001b[32m49\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m0\u001b[0m │ - │\n", "│ (\u001b[94mInputLayer\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ caption_lstm (\u001b[94mLSTM\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m1,574,912\u001b[0m │ caption_dropout[\u001b[32m…\u001b[0m │\n", "│ │ │ │ not_equal[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ attention │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m262,913\u001b[0m │ image_input[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m… │\n", "│ (\u001b[94mBahdanauAttention\u001b[0m) │ │ │ caption_lstm[\u001b[32m0\u001b[0m][\u001b[32m…\u001b[0m │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ merge (\u001b[94mConcatenate\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m1024\u001b[0m) │ \u001b[32m0\u001b[0m │ attention[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m], │\n", "│ │ │ │ caption_lstm[\u001b[32m0\u001b[0m][\u001b[32m…\u001b[0m │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ dense_relu (\u001b[94mDense\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m524,800\u001b[0m │ merge[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ dense_dropout │ (\u001b[96mNone\u001b[0m, \u001b[32m512\u001b[0m) │ \u001b[32m0\u001b[0m │ dense_relu[\u001b[32m0\u001b[0m][\u001b[32m0\u001b[0m] │\n", "│ (\u001b[94mDropout\u001b[0m) │ │ │ │\n", "├─────────────────────┼───────────────────┼────────────┼───────────────────┤\n", "│ output (\u001b[94mDense\u001b[0m) │ (\u001b[96mNone\u001b[0m, \u001b[32m7656\u001b[0m) │ \u001b[32m3,927,528\u001b[0m │ dense_dropout[\u001b[32m0\u001b[0m]… │\n", "└─────────────────────┴───────────────────┴────────────┴───────────────────┘\n", "\u001b[1m Total params: \u001b[0m\u001b[32m8,250,089\u001b[0m (31.47 MB)\n", "\u001b[1m Trainable params: \u001b[0m\u001b[32m8,250,089\u001b[0m (31.47 MB)\n", "\u001b[1m Non-trainable params: \u001b[0m\u001b[32m0\u001b[0m (0.00 B)\n", " Train steps/epoch: 11051\n", " Val steps/epoch: 1816\n", "\n", "Training for 50 epochs...\n", "Epoch 1/50\n", "I0000 00:00:1775612426.160821 169976 cuda_dnn.cc:529] Loaded cuDNN version 91002\n", "\u001b[1m11048/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 5.4579\n", "Epoch 1: val_loss improved from None to 4.57161, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 1: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m192s\u001b[0m 17ms/step - loss: 5.1972 - val_loss: 4.5716 - learning_rate: 0.0010\n", "Epoch 2/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.7530\n", "Epoch 2: val_loss improved from 4.57161 to 4.46729, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 2: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m188s\u001b[0m 17ms/step - loss: 4.7578 - val_loss: 4.4673 - learning_rate: 0.0010\n", "Epoch 3/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.6693\n", "Epoch 3: val_loss did not improve from 4.46729\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m188s\u001b[0m 17ms/step - loss: 4.6920 - val_loss: 4.5085 - learning_rate: 0.0010\n", "Epoch 4/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.6785\n", "Epoch 4: val_loss did not improve from 4.46729\n", "\n", "Epoch 4: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m187s\u001b[0m 17ms/step - loss: 4.7026 - val_loss: 4.6784 - learning_rate: 0.0010\n", "Epoch 5/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.6077\n", "Epoch 5: val_loss did not improve from 4.46729\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m188s\u001b[0m 17ms/step - loss: 4.5923 - val_loss: 4.5105 - learning_rate: 5.0000e-04\n", "Epoch 6/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.5364\n", "Epoch 6: val_loss improved from 4.46729 to 4.44435, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 6: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.5445 - val_loss: 4.4444 - learning_rate: 5.0000e-04\n", "Epoch 7/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.4867\n", "Epoch 7: val_loss improved from 4.44435 to 4.38079, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 7: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m187s\u001b[0m 17ms/step - loss: 4.4927 - val_loss: 4.3808 - learning_rate: 5.0000e-04\n", "Epoch 8/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.4589\n", "Epoch 8: val_loss did not improve from 4.38079\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m187s\u001b[0m 17ms/step - loss: 4.4756 - val_loss: 4.4305 - learning_rate: 5.0000e-04\n", "Epoch 9/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.4644\n", "Epoch 9: val_loss did not improve from 4.38079\n", "\n", "Epoch 9: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.4659 - val_loss: 4.4818 - learning_rate: 5.0000e-04\n", "Epoch 10/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.3906\n", "Epoch 10: val_loss improved from 4.38079 to 4.33908, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 10: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m187s\u001b[0m 17ms/step - loss: 4.3772 - val_loss: 4.3391 - learning_rate: 2.5000e-04\n", "Epoch 11/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.3284\n", "Epoch 11: val_loss did not improve from 4.33908\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m187s\u001b[0m 17ms/step - loss: 4.3365 - val_loss: 4.3643 - learning_rate: 2.5000e-04\n", "Epoch 12/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.3017\n", "Epoch 12: val_loss did not improve from 4.33908\n", "\n", "Epoch 12: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m186s\u001b[0m 17ms/step - loss: 4.3126 - val_loss: 4.3452 - learning_rate: 2.5000e-04\n", "Epoch 13/50\n", "\u001b[1m11049/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2531\n", "Epoch 13: val_loss did not improve from 4.33908\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m184s\u001b[0m 17ms/step - loss: 4.2552 - val_loss: 4.3426 - learning_rate: 1.2500e-04\n", "Epoch 14/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2051\n", "Epoch 14: val_loss improved from 4.33908 to 4.32786, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 14: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m186s\u001b[0m 17ms/step - loss: 4.2269 - val_loss: 4.3279 - learning_rate: 1.2500e-04\n", "Epoch 15/50\n", "\u001b[1m11048/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.2146\n", "Epoch 15: val_loss improved from 4.32786 to 4.31915, saving model to /content/computer vision/models/model_vgg19.h5\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Epoch 15: finished saving model to /content/computer vision/models/model_vgg19.h5\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m202s\u001b[0m 18ms/step - loss: 4.2120 - val_loss: 4.3192 - learning_rate: 1.2500e-04\n", "Epoch 16/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1837\n", "Epoch 16: val_loss did not improve from 4.31915\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m185s\u001b[0m 17ms/step - loss: 4.1944 - val_loss: 4.3407 - learning_rate: 1.2500e-04\n", "Epoch 17/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1650\n", "Epoch 17: val_loss did not improve from 4.31915\n", "\n", "Epoch 17: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m188s\u001b[0m 17ms/step - loss: 4.1806 - val_loss: 4.3310 - learning_rate: 1.2500e-04\n", "Epoch 18/50\n", "\u001b[1m11048/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1517\n", "Epoch 18: val_loss did not improve from 4.31915\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m186s\u001b[0m 17ms/step - loss: 4.1530 - val_loss: 4.3467 - learning_rate: 6.2500e-05\n", "Epoch 19/50\n", "\u001b[1m11050/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m━\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.1332\n", "Epoch 19: val_loss did not improve from 4.31915\n", "\n", "Epoch 19: ReduceLROnPlateau reducing learning rate to 3.125000148429535e-05.\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m185s\u001b[0m 17ms/step - loss: 4.1348 - val_loss: 4.3427 - learning_rate: 6.2500e-05\n", "Epoch 20/50\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 4.0971\n", "Epoch 20: val_loss did not improve from 4.31915\n", "\u001b[1m11051/11051\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m186s\u001b[0m 17ms/step - loss: 4.1133 - val_loss: 4.3471 - learning_rate: 3.1250e-05\n", "Epoch 20: early stopping\n", "Restoring model weights from the end of the best epoch: 15.\n", "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n", "\n", "Model saved to: /content/computer vision/models/model_vgg19.h5\n", "Loss plot saved to: /content/computer vision/outputs/loss_vgg19.png\n", "\n", "✓ Training complete!\n" ] } ] }, { "cell_type": "code", "source": [ "!cp -r \"/content/computer vision\" \"/content/drive/MyDrive/\"" ], "metadata": { "id": "OIU_d-5g4OID" }, "execution_count": 8, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "id": "FSAvGV17NMxZ" }, "execution_count": null, "outputs": [] } ] }