Verified Commit d539b488 authored by Yaoyao Liu's avatar Yaoyao Liu
Browse files

Delete the slurm scripts

parent 43e2a142
import os
def run_exp(dataset='cifar100', phase=5, gpu=0):
machine = 'slurm'
time = '6-23:59:59'
if dataset=='cifar100':
if phase==5:
the_options = 'options/config_cifar100_5phase.yaml'
elif phase==10:
the_options = 'options/config_cifar100_10phase.yaml'
elif phase==25:
the_options = 'options/config_cifar100_25phase.yaml'
else:
raise ValueError('Please set correct number of phases.')
elif dataset=='imagenet_sub':
if phase==5:
the_options = 'options/config_imagenet_subset_5phase.yaml'
elif phase==10:
the_options = 'options/config_imagenet_subset_10phase.yaml'
elif phase==25:
the_options = 'options/config_imagenet_subset_25phase.yaml'
else:
raise ValueError('Please set correct number of phases.')
else:
raise ValueError('Please set correct dataset.')
the_command = 'python3 -minclearn'
the_command += ' --options ' + the_options
the_command += ' --fixed-memory'
the_command += ' --device ' + str(gpu)
the_command += ' --save_model'
if machine == 'volta':
the_command += ' 2>&1 | tee ' + 'log_rmm_' + dataset + '_' + str(phase) + 'phase'
os.system(the_command)
elif machine == 'slurm':
tmp_script_path = './tmp_scripts'
if not os.path.exists(tmp_script_path):
os.mkdir(tmp_script_path)
os.system('cp ./scripts/run_base.sh ./tmp_scripts/rmm_'+ dataset + '_' + str(phase) + 'phase' +'.sh')
f = open('./tmp_scripts/rmm_' + dataset + '_' + str(phase) + 'phase' +'.sh', "a")
f.write(the_command)
f.close()
os.system('sbatch -p gpu20 -t '+time+' --gres gpu:1 ./tmp_scripts/rmm_' + dataset + '_' + str(phase) + 'phase' +'.sh')
else:
raise ValueError('Please set correct workstation.')
#run_exp(dataset='cifar100', phase=5, gpu=0)
#run_exp(dataset='cifar100', phase=10, gpu=0)
#run_exp(dataset='cifar100', phase=25, gpu=0)
run_exp(dataset='imagenet_sub', phase=5, gpu=0)
run_exp(dataset='imagenet_sub', phase=10, gpu=0)
#run_exp(dataset='imagenet_sub', phase=25, gpu=0)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment