mutliple run script and auto experiment name

This commit is contained in:
MishaLaskin
2020-02-10 10:41:24 -08:00
parent ca78c256d1
commit 85bfafddfa
2 changed files with 25 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
gpuList=(1 2 3 4 5 6 7)
(
for i in ${gpuList[@]}; do
CUDA_VISIBLE_DEVICES=$i python train.py \
--domain_name reacher \
--task_name easy \
--encoder_type pixel \
--action_repeat 4 \
--save_tb --pre_transform_image_size 100 --image_size 84 \
--work_dir ./tmp/curl/reacher_easy \
--agent curl_sac --frame_stack 3 \
--seed -1 --critic_lr 1e-3 --actor_lr 1e-3 --eval_freq 20000 --batch_size 128 --num_train_steps 1000000 &
done
)
echo "Launched CURL script"
+8 -1
View File
@@ -151,7 +151,7 @@ def make_agent(obs_shape, action_shape, args, device):
def main():
args = parse_args()
if args.seed == -1:
args.__dict__["seed"] = np.random.randint(1,1000)
args.__dict__["seed"] = np.random.randint(1,1000000)
utils.set_seed_everywhere(args.seed)
env = dmc2gym.make(
domain_name=args.domain_name,
@@ -169,6 +169,13 @@ def main():
# stack several consecutive frames together
if args.encoder_type == 'pixel':
env = utils.FrameStack(env, k=args.frame_stack)
# make directory
ts = time.gmtime()
ts = time.strftime("%m-%d", ts)
env_name = args.domain_name + '-' + args.task_name
exp_name = env_name + '-' + ts + '-im' + str(args.image_size) +'-b' + str(args.batch_size) + '-s' + str(args.seed)
args.work_dir = args.work_dir + '/' + exp_name
utils.make_dir(args.work_dir)
video_dir = utils.make_dir(os.path.join(args.work_dir, 'video'))