Team Ai
Apppublic

HarryLee/eCommerceImageCaptioning

sourceHugging Faceupdated 4y agoView on Hugging Face
2likes
evaluate_caption.sh36 linesDownload Raw Back to caption
1#!/usr/bin/env bash2 3# The port for communication. Note that if you want to run multiple tasks on the same machine,4# you need to specify different port numbers.5export MASTER_PORT=10816export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,77export GPUS_PER_NODE=88 9user_dir=../../ofa_module10bpe_dir=../../utils/BPE11 12data=../../dataset/caption_data/caption_test.tsv13path=../../checkpoints/caption_large_best_clean.pt14result_path=../../results/caption15selected_cols=1,4,216split='test'17 18python3 -m torch.distributed.launch --nproc_per_node=${GPUS_PER_NODE} --master_port=${MASTER_PORT} ../../evaluate.py \19    ${data} \20    --path=${path} \21    --user-dir=${user_dir} \22    --task=caption \23    --batch-size=16 \24    --log-format=simple --log-interval=10 \25    --seed=7 \26    --gen-subset=${split} \27    --results-path=${result_path} \28    --beam=5 \29    --max-len-b=16 \30    --no-repeat-ngram-size=3 \31    --fp16 \32    --num-workers=0 \33    --model-overrides="{\"data\":\"${data}\",\"bpe_dir\":\"${bpe_dir}\",\"eval_cider\":False,\"selected_cols\":\"${selected_cols}\"}"34 35python coco_eval.py ../../results/caption/test_predict.json ../../dataset/caption_data/test_caption_coco_format.json36