Compare commits
3 Commits
main
...
origin-ver
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e44a6342e | |||
| 0a533c0647 | |||
| 007e160b13 |
@ -37,7 +37,7 @@ def construct_instrs(anno_dir, dataset, splits, tokenizer, max_instr_len=512, is
|
|||||||
# Split multiple instructions into separate entries
|
# Split multiple instructions into separate entries
|
||||||
for j, instr in enumerate(item['instructions']):
|
for j, instr in enumerate(item['instructions']):
|
||||||
new_item = dict(item)
|
new_item = dict(item)
|
||||||
new_item['instr_id'] = '%s_%d' % (item['path_id'], j)
|
new_item['instr_id'] = '%s_%d' % (item['id'], j)
|
||||||
new_item['instruction'] = instr
|
new_item['instruction'] = instr
|
||||||
new_item['instr_encoding'] = item['instr_encodings'][j][:max_instr_len]
|
new_item['instr_encoding'] = item['instr_encodings'][j][:max_instr_len]
|
||||||
del new_item['instructions']
|
del new_item['instructions']
|
||||||
|
|||||||
@ -58,12 +58,12 @@ def build_dataset(args, rank=0, is_test=False):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# val_env_names = ['val_train_seen']
|
# val_env_names = ['val_train_seen']
|
||||||
val_env_names = ['val_train_seen', 'val_seen', 'val_unseen']
|
val_env_names = ['val_seen', 'val_unseen']
|
||||||
if args.dataset == 'r4r' and (not args.test):
|
if args.dataset == 'r4r' and (not args.test):
|
||||||
val_env_names[-1] == 'val_unseen_sampled'
|
val_env_names[-1] == 'val_unseen_sampled'
|
||||||
|
|
||||||
if args.submit and args.dataset != 'r4r':
|
# if args.submit and args.dataset != 'r4r':
|
||||||
val_env_names.append('test')
|
# val_env_names.append('test')
|
||||||
|
|
||||||
val_envs = {}
|
val_envs = {}
|
||||||
for split in val_env_names:
|
for split in val_env_names:
|
||||||
|
|||||||
@ -324,7 +324,8 @@ class GMapObjectNavAgent(Seq2SeqAgent):
|
|||||||
ml_loss = 0.
|
ml_loss = 0.
|
||||||
og_loss = 0.
|
og_loss = 0.
|
||||||
|
|
||||||
for t in range(self.args.max_action_len):
|
# for t in range(self.args.max_action_len):
|
||||||
|
for t in range(1):
|
||||||
for i, gmap in enumerate(gmaps):
|
for i, gmap in enumerate(gmaps):
|
||||||
if not ended[i]:
|
if not ended[i]:
|
||||||
gmap.node_step_ids[obs[i]['viewpoint']] = t + 1
|
gmap.node_step_ids[obs[i]['viewpoint']] = t + 1
|
||||||
|
|||||||
@ -339,7 +339,7 @@ class ReverieObjectNavBatch(object):
|
|||||||
self._next_minibatch(**kwargs)
|
self._next_minibatch(**kwargs)
|
||||||
|
|
||||||
scanIds = [item['scan'] for item in self.batch]
|
scanIds = [item['scan'] for item in self.batch]
|
||||||
viewpointIds = [item['path'][0] for item in self.batch]
|
viewpointIds = [item['path'][-1] for item in self.batch]
|
||||||
headings = [item['heading'] for item in self.batch]
|
headings = [item['heading'] for item in self.batch]
|
||||||
self.env.newEpisodes(scanIds, viewpointIds, headings)
|
self.env.newEpisodes(scanIds, viewpointIds, headings)
|
||||||
return self._get_obs()
|
return self._get_obs()
|
||||||
@ -357,7 +357,7 @@ class ReverieObjectNavBatch(object):
|
|||||||
shortest_distances = self.shortest_distances[scan]
|
shortest_distances = self.shortest_distances[scan]
|
||||||
|
|
||||||
path = sum(pred_path, [])
|
path = sum(pred_path, [])
|
||||||
assert gt_path[0] == path[0], 'Result trajectories should include the start position'
|
# assert gt_path[0] == path[0], 'Result trajectories should include the start position'
|
||||||
|
|
||||||
scores['action_steps'] = len(pred_path) - 1
|
scores['action_steps'] = len(pred_path) - 1
|
||||||
scores['trajectory_steps'] = len(path) - 1
|
scores['trajectory_steps'] = len(path) - 1
|
||||||
|
|||||||
@ -66,10 +66,10 @@ def build_dataset(args, rank=0):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# val_env_names = ['val_train_seen']
|
# val_env_names = ['val_train_seen']
|
||||||
val_env_names = ['val_train_seen', 'val_seen', 'val_unseen']
|
val_env_names = ['val_seen', 'val_unseen']
|
||||||
|
|
||||||
if args.submit:
|
# if args.submit:
|
||||||
val_env_names.append('test')
|
# val_env_names.append('test')
|
||||||
|
|
||||||
val_envs = {}
|
val_envs = {}
|
||||||
for split in val_env_names:
|
for split in val_env_names:
|
||||||
|
|||||||
@ -10,7 +10,7 @@ obj_ft_dim=768
|
|||||||
ngpus=1
|
ngpus=1
|
||||||
seed=0
|
seed=0
|
||||||
|
|
||||||
name=${train_alg}-${features}
|
name=${train_alg}-${features}-reverie-glip-adversarial
|
||||||
name=${name}-seed.${seed}
|
name=${name}-seed.${seed}
|
||||||
name=${name}-init.aug.45k
|
name=${name}-init.aug.45k
|
||||||
|
|
||||||
@ -57,11 +57,11 @@ flag="--root_dir ${DATA_ROOT}
|
|||||||
# train
|
# train
|
||||||
CUDA_VISIBLE_DEVICES='0' python r2r/main_nav.py $flag \
|
CUDA_VISIBLE_DEVICES='0' python r2r/main_nav.py $flag \
|
||||||
--tokenizer bert \
|
--tokenizer bert \
|
||||||
--bert_ckpt_file 'put the pretrained model (see pretrain_src) here' \
|
--bert_ckpt_file '../datasets/REVERIE/exprs_map/pretrain/cmt-vitbase-mlm.mrc.sap.og-init.lxmert-aug.speaker/ckpts/model_step_100000.pt' \
|
||||||
--eval_first
|
--eval_first
|
||||||
|
|
||||||
# test
|
# test
|
||||||
CUDA_VISIBLE_DEVICES='0' python r2r/main_nav.py $flag \
|
# CUDA_VISIBLE_DEVICES='0' python r2r/main_nav.py $flag \
|
||||||
--tokenizer bert \
|
# --tokenizer bert \
|
||||||
--resume_file ../datasets/R2R/trained_models/best_val_unseen \
|
# --resume_file ../datasets/R2R/trained_models/best_val_unseen \
|
||||||
--test --submit
|
# --test --submit
|
||||||
|
|||||||
@ -10,7 +10,7 @@ obj_ft_dim=768
|
|||||||
ngpus=1
|
ngpus=1
|
||||||
seed=0
|
seed=0
|
||||||
|
|
||||||
name=${train_alg}-${features}
|
name=${train_alg}-${features}-adversarial-but-original-model-with-glip-filter
|
||||||
name=${name}-seed.${seed} #-${ngpus}gpus
|
name=${name}-seed.${seed} #-${ngpus}gpus
|
||||||
|
|
||||||
outdir=${DATA_ROOT}/REVERIE/exprs_map/finetune/${name}
|
outdir=${DATA_ROOT}/REVERIE/exprs_map/finetune/${name}
|
||||||
@ -59,13 +59,14 @@ flag="--root_dir ${DATA_ROOT}
|
|||||||
--gamma 0."
|
--gamma 0."
|
||||||
|
|
||||||
# train
|
# train
|
||||||
CUDA_VISIBLE_DEVICES='0' python reverie/main_nav_obj.py $flag \
|
# CUDA_VISIBLE_DEVICES='0' python reverie/main_nav_obj.py $flag \
|
||||||
--tokenizer bert \
|
# --tokenizer bert \
|
||||||
--bert_ckpt_file 'put the pretrained model (see pretrain_src) here' \
|
# --resume_file ../datasets/REVERIE/exprs_map/finetune/dagger-vitbase-adversarial-but-original-model-with-glip-filter-seed.0/ckpts/best_val_unseen \
|
||||||
--eval_first
|
# --bert_ckpt_file '../datasets/REVERIE/exprs_map/pretrain/cmt-vitbase-mlm.mrc.sap.og-init.lxmert-aug.speaker/ckpts/model_step_100000.pt' \
|
||||||
|
# --eval_first
|
||||||
|
|
||||||
# test
|
# test
|
||||||
CUDA_VISIBLE_DEVICES='0' python reverie/main_nav_obj.py $flag \
|
CUDA_VISIBLE_DEVICES='0' python reverie/main_nav_obj.py $flag \
|
||||||
--tokenizer bert \
|
--tokenizer bert \
|
||||||
--resume_file ../datasets/REVERIE/trained_models/best_val_unseen \
|
--resume_file ../datasets/REVERIE/exprs_map/finetune/dagger-vitbase-adversarial-but-original-model-with-glip-filter-seed.0/ckpts/best_val_unseen \
|
||||||
--test --submit
|
--test --submit
|
||||||
Loading…
Reference in New Issue
Block a user