mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
hparams as dict [blocked by 1041] (#1029)
* hparams as dict * hparams as dict * fixing * fixing * fixing * fixing * typing * typing * chnagelog * update set hparams * use setter * simplify * chnagelog * imports * pylint * typing * Update training_io.py * Update training_io.py * Update lightning.py * Update test_trainer.py * Update __init__.py * Update base.py * Update utils.py * Update test_trainer.py * Update training_io.py * Update test_trainer.py * Update test_trainer.py * Update test_trainer.py * Update test_trainer.py * Update callback_config.py * Update callback_config.py * Update test_trainer.py Co-authored-by: William Falcon <waf2107@columbia.edu>
This commit is contained in:
co-authored by
William Falcon
parent
6a39573267
commit
e586ed4767
@@ -36,16 +36,14 @@ class ModelIO(object):
|
||||
"""
|
||||
|
||||
|
||||
def load_hparams_from_tags_csv(tags_csv):
|
||||
def load_hparams_from_tags_csv(tags_csv) -> Namespace:
|
||||
if not os.path.isfile(tags_csv):
|
||||
log.warning(f'Missing Tags: {tags_csv}.')
|
||||
return Namespace()
|
||||
|
||||
tags = {}
|
||||
with open(tags_csv) as f:
|
||||
csv_reader = csv.reader(f, delimiter=',')
|
||||
for row in list(csv_reader)[1:]:
|
||||
tags[row[0]] = convert(row[1])
|
||||
tags = {row[0]: convert(row[1]) for row in list(csv_reader)[1:]}
|
||||
ns = Namespace(**tags)
|
||||
return ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user