From 63b09830a79342bb4e056b263feadacd428d2372 Mon Sep 17 00:00:00 2001 From: Lee Stott Date: Mon, 6 Jul 2026 15:53:43 +0100 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../08-TransferLearning/TransferLearningTF.ipynb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lessons/4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb b/lessons/4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb index c7f0a7dd..1160b8b6 100644 --- a/lessons/4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb +++ b/lessons/4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb @@ -512,8 +512,9 @@ "vgg = keras.applications.VGG16()\n", "_weights_path = os.path.join(os.path.expanduser(\"~\"), \".keras\", \"models\",\n", " \"vgg16_weights_tf_dim_ordering_tf_kernels.h5\")\n", - "if _sha256(_weights_path) != VGG16_WEIGHTS_SHA256:\n", - " warnings.warn(\"VGG16 weights SHA-256 mismatch - verify file integrity before use\")\n", +if _sha256(_weights_path) != VGG16_WEIGHTS_SHA256: + warnings.warn("VGG16 weights SHA-256 mismatch - verify file integrity before use") + raise ValueError("Aborting because VGG16 weights failed integrity check") "inp = keras.applications.vgg16.preprocess_input(x_sample[:1])\n", "\n", "res = vgg(inp)\n",