Skip to content

Commit

Permalink
Update super.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dingguanglei committed Nov 18, 2019
1 parent a69150b commit b4cfce8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jdit/trainer/super.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def regist_config(self, opt_model_data: Union[SupTrainer, Optimizer, Model, Data
config_dic.update(obj_config_dic)
# pdg = pd.DataFrame.from_dict(config_dic, orient="index").transpose()
# pdg.to_csv(path, mode="w", encoding="utf-8", index=False, header=True)
with open(path, "w", encoding="utf-8") as csvfile:
with open(path, "w", newline = "", encoding="utf-8") as csvfile:
writer = csv.writer(csvfile)
# 先写入columns_name
writer.writerow(config_dic.keys())
Expand All @@ -523,7 +523,7 @@ def regist_config(self, opt_model_data: Union[SupTrainer, Optimizer, Model, Data
config_dic.update(obj_config_dic)
# pdg = pd.DataFrame.from_dict(config_dic, orient="index").transpose()
# pdg.to_csv(path, mode="a", encoding="utf-8", index=False, header=False)
with open(path, "a", encoding="utf-8") as csvfile:
with open(path, "a",newline = "", encoding="utf-8") as csvfile:
writer = csv.writer(csvfile)
# 先写入columns_name
# writer.writerow(config_dic.keys())
Expand All @@ -542,7 +542,7 @@ def write(self, step: int, current_epoch: int, msg_dic: dict, filename: str, hea
dic.update(msg_dic)
# pdg = pd.DataFrame.from_dict(dic, orient="index").transpose()
# pdg.to_csv(path, mode="a", encoding="utf-8", index=False, header=header)
with open(path, "a", encoding="utf-8") as csvfile:
with open(path, "a", newline = "", encoding="utf-8") as csvfile:
writer = csv.writer(csvfile)
if header:
writer.writerow(dic.keys())
Expand Down

0 comments on commit b4cfce8

Please sign in to comment.