-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrain.sh
More file actions
32 lines (22 loc) · 832 Bytes
/
train.sh
File metadata and controls
32 lines (22 loc) · 832 Bytes
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
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
#!/bin/bash
start_time=$(date +%s)
# Define save directory
save_dir="job_name"
# Make sure the directory exists
mkdir -p "$save_dir"
# Optional: Create log file with timestamp
log_file="$save_dir/train_log_$(date +%Y%m%d_%H%M%S).txt"
# Run your command and log stdout/stderr
python train.py \
--checkpoint weights/PeskaVLP.pth \
--cvs_config configs/config_cvsadaptnet.py \
--class_prompt class_prompts/class_prompt_endoscapes_manual.txt \
--batch_size 64 \
--data_mode both \
--save_dir "$save_dir" 2>&1 | tee "$log_file"
end_time=$(date +%s)
elapsed=$(( end_time - start_time ))
elapsed_msg="Elapsed time: $((elapsed / 3600))h $(((elapsed / 60) % 60))m $((elapsed % 60))s"
# Print to terminal and append to log
echo "$elapsed_msg" | tee -a "$log_file"