Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix nnictl log and experiment save/load #3168

Merged
merged 2 commits into from
Dec 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions nni/tools/nnictl/nnictl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ def log_internal(args, filetype):
'''internal function to call get_log_content'''
file_name = get_config_filename(args)
if filetype == 'stdout':
file_full_path = os.path.join(NNICTL_HOME_DIR, file_name, 'stdout')
file_full_path = os.path.join(NNICTL_HOME_DIR, file_name, 'log', 'nnictl_stdout.log')
else:
file_full_path = os.path.join(NNICTL_HOME_DIR, file_name, 'stderr')
file_full_path = os.path.join(NNICTL_HOME_DIR, file_name, 'log', 'nnictl_stderr.log')
print(check_output_command(file_full_path, head=args.head, tail=args.tail))

def log_stdout(args):
Expand Down Expand Up @@ -854,8 +854,9 @@ def save_experiment(args):
except IOError:
print_error('Write file to %s failed!' % os.path.join(temp_nnictl_dir, '.experiment'))
exit(1)
nnictl_config_dir = os.path.join(NNICTL_HOME_DIR, args.id)
shutil.copytree(nnictl_config_dir, os.path.join(temp_nnictl_dir, args.id))
nnictl_log_dir = os.path.join(NNICTL_HOME_DIR, args.id, 'log')
shutil.copytree(nnictl_log_dir, os.path.join(temp_nnictl_dir, args.id, 'log'))
shutil.copy(os.path.join(NNICTL_HOME_DIR, args.id, '.config'), os.path.join(temp_nnictl_dir, args.id, '.config'))

# Step3. Copy code dir
if args.saveCodeDir:
Expand Down