-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
34 lines (23 loc) · 813 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
#Manually fix the GPU
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
#Add EDM to path to load models properly
# change this line to point to your specific path
sys.path.append("/home/sravula/MRI_Sampling_Diffusion/edm")
from utils.exp_utils import set_all_seeds, parse_args, parse_config
from learners.gradientlearner import MaskLearner
def main():
args = parse_args(globals()['__doc__'])
hparams = parse_config(args.config)
print("\nWriting to ", os.path.join(hparams.save_dir, args.doc), '\n')
set_all_seeds(hparams.seed)
learner = MaskLearner(hparams, args)
if args.test or args.baseline:
learner.test()
else:
learner.run_meta_opt()
return 0
if __name__ == '__main__':
sys.exit(main())