Skip to content

Commit e4407b9

Browse files
committed
added str to log
1 parent 0f24c2b commit e4407b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mozi/log.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ def _save_to_database(self, epoch, train_cost, valid_cost, best_valid_error):
112112
elif type(v) is float:
113113
query += k + ' REAL,'
114114
else:
115-
raise Exception("Error: The input types for records '{}' of {}".format(k, type(v))
116-
+ " is not primitive types (str, int, float).")
115+
try:
116+
query += str(k) + ' TEXT,'
117+
except:
118+
raise Exception("Error: The input types for records '{}' of {}".format(k, type(v))
119+
+ " is not primitive types (str, int, float) and not castable as str.")
117120

118121
query += 'epoch INT, train_cost REAL, valid_cost REAL, best_valid_error REAL);'
119122

0 commit comments

Comments
 (0)