File size: 775 Bytes
c1f1d32 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import subprocess
n_action_steps_values = [1, 2, 4, 8, 16]
cuda_device = 7
command_template = (
"CUDA_VISIBLE_DEVICES={cuda_device} MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa "
"HYDRA_FULL_ERROR=1 python train.py --config-name=test_sq2 "
"n_action_steps={n_action_steps}"
)
for n_action_steps in n_action_steps_values:
command = command_template.format(cuda_device = cuda_device, n_action_steps=n_action_steps)
print(f"Running command: {command}")
try:
subprocess.run(command, shell=True, check=True)
print(f"Command for n_action_steps={n_action_steps} executed successfully!")
except subprocess.CalledProcessError as e:
print(f"Error occurred while executing command for n_action_steps={n_action_steps}: {e}")
|