Spaces:
Sleeping
Sleeping
File size: 59,432 Bytes
290f366 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | {
"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:00<?, ?it/s]WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
"I0000 00:00:1775604723.832566 8324 service.cc:152] XLA service 0x7b98bc008340 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:\n",
"I0000 00:00:1775604723.832629 8324 service.cc:160] StreamExecutor device (0): Tesla T4, Compute Capability 7.5\n",
"2026-04-07 23:32:03.893227: I tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.cc:269] disabling MLIR crash reproducer, set env var `MLIR_CRASH_REPRODUCER_DIRECTORY` to enable.\n",
"I0000 00:00:1775604724.047231 8324 cuda_dnn.cc:529] Loaded cuDNN version 91002\n",
"2026-04-07 23:32:06.069926: 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.46 = (f32[1,512,28,28]{3,2,1,0}, u8[0]{0}) custom-call(f32[1,256,28,28]{3,2,1,0} %bitcast.498, f32[512,256,3,3]{3,2,1,0} %bitcast.505, f32[512]{0} %bitcast.507), 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_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": []
}
]
} |