From 32d36c7b690c9d72c12269f9acf306a45860964a Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 12:44:58 +0100 Subject: Fix train_cnn_v2_full.sh for updated API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - KERNEL_SIZES: Use comma-separated values (3,3,3 not 3 3 3) - Remove --channels (no longer exists in uniform 12D→4D architecture) - Add --num-layers parameter - Use export_cnn_v2_weights.py (storage buffer) instead of export_cnn_v2_shader.py - Fix duplicate export: only export in step 2 (training) or validation mode Co-Authored-By: Claude Sonnet 4.5 --- scripts/train_cnn_v2_full.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts/train_cnn_v2_full.sh') diff --git a/scripts/train_cnn_v2_full.sh b/scripts/train_cnn_v2_full.sh index db55a8b..5a4e55e 100755 --- a/scripts/train_cnn_v2_full.sh +++ b/scripts/train_cnn_v2_full.sh @@ -53,8 +53,8 @@ DETECTOR="harris" # FULL_IMAGE="--full-image" # IMAGE_SIZE=256 -KERNEL_SIZES="3 3 3" -CHANNELS="8 4 4" +KERNEL_SIZES="3,3,3" # Comma-separated per-layer kernel sizes +NUM_LAYERS=3 if [ "$VALIDATE_ONLY" = true ]; then echo "=== CNN v2 Validation Only ===" @@ -79,7 +79,7 @@ python3 training/train_cnn_v2.py \ --patches-per-image $PATCHES_PER_IMAGE \ --detector $DETECTOR \ --kernel-sizes $KERNEL_SIZES \ - --channels $CHANNELS \ + --num-layers $NUM_LAYERS \ --epochs $EPOCHS \ --batch-size $BATCH_SIZE \ --checkpoint-dir "$CHECKPOINT_DIR" \ @@ -103,10 +103,10 @@ if [ ! -f "$FINAL_CHECKPOINT" ]; then FINAL_CHECKPOINT=$(ls -t "$CHECKPOINT_DIR"/checkpoint_epoch_*.pth | head -1) fi -echo "[2/4] Exporting final checkpoint to WGSL shaders..." +echo "[2/4] Exporting final checkpoint to binary weights..." echo "Checkpoint: $FINAL_CHECKPOINT" -python3 training/export_cnn_v2_shader.py "$FINAL_CHECKPOINT" \ - --output-dir workspaces/main/shaders +python3 training/export_cnn_v2_weights.py "$FINAL_CHECKPOINT" \ + --output-weights workspaces/main/weights/cnn_v2_weights.bin if [ $? -ne 0 ]; then echo "Error: Shader export failed" @@ -152,8 +152,8 @@ fi mkdir -p "$VALIDATION_DIR" echo " Using checkpoint: $FINAL_CHECKPOINT" -# Export weights only if not in validate mode -if [ "$VALIDATE_ONLY" = false ]; then +# Export weights for validation mode (already exported in step 2 for training mode) +if [ "$VALIDATE_ONLY" = true ]; then python3 training/export_cnn_v2_weights.py "$FINAL_CHECKPOINT" \ --output-weights workspaces/main/weights/cnn_v2_weights.bin > /dev/null 2>&1 fi -- cgit v1.2.3