fast-autoaugment icon indicating copy to clipboard operation
fast-autoaugment copied to clipboard

NameError: name 'args' is not defined

Open guillermoim opened this issue 4 years ago • 2 comments

Hi, I've tried to run the code for searching policies, but there is no way I can make it run on a single machine with several GPUs and the problem seems to be with Ray. I do initialize the ray server correctly, but apparently the trouble is with the train_and_eval function.

Any suggestion about what I could be doing wrong/ how to workaround this?

2020-08-15 10:18:09,387 ERROR worker.py:1717 -- Possible unhandled error from worker: ray_worker (pid=13478, host=macaron) File "FastAutoAugment/search.py", line 66, in train_model result = train_and_eval(None, dataroot, cv_ratio_test, cv_fold, save_path=save_path, only_eval=skip_exist) File "/home/gim282/data_augmentation/good/FastAutoAugment/train.py", line 123, in train_and_eval add_filehandler(logger, args.save + '.log') NameError: name 'args' is not defined

guillermoim avatar Aug 15 '20 10:08 guillermoim

@guillermoim Hello! I met the same problem.Have you solved the problem?And how?Thank you very much!

XuChunqiao avatar Sep 05 '20 07:09 XuChunqiao

@guillermoim and @XuChunqiao it took me while to find it... in train.py line 122, try do sth like this:

    if is_master:
        # add_filehandler(logger, args.save + '.log')
        add_filehandler(logger, 'logger.log')

michklim avatar Sep 07 '20 08:09 michklim