diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/train_cnn_v2_full.sh | 16 |
1 files changed, 8 insertions, 8 deletions
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 |
