# conda activate sar3d
master_port=$((RANDOM % (65535 - 49152 + 1) + 49152))
filename="release"

model_name_or_path=/mnt/ywchen/A6000-projects-backup/PointLLM-read2/checkpoints/PointLLM7B
data_path=/mnt/ywchen/data/sar3d-dataset
anno_path=/cpfs01/user/lanyushi.p/Repo/cyw/log/PointLLM_brief_description_660K_filtered.json
output_dir=/mnt/ywchen/logs/PointLLM/$filename
point_backbone_ckpt=/mnt/ywchen/A6000-projects-backup/PointLLM-read2/checkpoints/PointLLM7B/vqvae-ckpt.pt


GPU_NUM=$(echo $CUDA_VISIBLE_DEVICES | awk -F',' '{print NF}')
torchrun --nnodes=1 --nproc_per_node=5 --master_port=$master_port pointllm/train/train_mem.py \
    --model_name_or_path $model_name_or_path \
    --data_path $data_path \
    --anno_path $anno_path \
    --output_dir $output_dir \
    --version v1 \
    --model_max_length 2048 \
    --num_train_epochs 3 \
    --per_device_train_batch_size 60 \
    --per_device_eval_batch_size 2 \
    --gradient_accumulation_steps 1 \
    --evaluation_strategy "no" \
    --save_strategy "steps" \
    --save_steps 2400 \
    --save_total_limit 1 \
    --learning_rate 2e-3 \
    --weight_decay 0. \
    --warmup_ratio 0.03 \
    --lr_scheduler_type "cosine" \
    --logging_steps 1 \
    --bf16 True \
    --evaluation_strategy "no" \
    --fix_llm True \
    --fix_pointnet True \
    --gradient_checkpointing True \
    --report_to wandb \
    --run_name $filename \
    --point_backbone_ckpt $point_backbone_ckpt \
    --use_color True