Unanswered
Hello, All. I’Ve Recently Started Experiencing A Weird Issue With Arg Parsing Where Any String Values Are Being Repeated As Lists Of Strings When The Values Are Sent To The Clearml Server (See Attached Screenshot). I Believe This Issue Started Around The
Found the issue: my bad practice for import 😛
You need to import clearml before doing argument parser. Bad way:
import argparse
def handleArgs():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config-file', type=str, default='train_config.yaml',
help='train config file')
parser.add_argument('--device', type=int, default=0,
help='cuda device index to run the training')
args = parser.parse_args()
return args
if __name__ == "__main__":
args=handleArgs()
from clearml import Task
task = Task.init(project_name='bugs', task_name='argparse',reuse_last_task_id=False)
print("Done.")
Should be:
import argparse
from clearml import Task
def handleArgs():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config-file', type=str, default='train_config.yaml',
help='train config file')
parser.add_argument('--device', type=int, default=0,
help='cuda device index to run the training')
args = parser.parse_args()
return args
if __name__ == "__main__":
args=handleArgs()
task = Task.init(project_name='bugs', task_name='argparse',reuse_last_task_id=False)
print("Done.")
150 Views
0
Answers
one year ago
one year ago