remove np object, make default str
This commit is contained in:
parent
4d2b7a74f1
commit
51be45547f
@ -211,10 +211,10 @@ def record_params(config: Dict[str, Any], full_path: Path) -> None:
|
|||||||
}
|
}
|
||||||
|
|
||||||
with open(params_record_path, "w") as handle:
|
with open(params_record_path, "w") as handle:
|
||||||
rapidjson.dump(run_params, handle, indent=4, default=np_encoder,
|
rapidjson.dump(
|
||||||
number_mode=rapidjson.NM_NATIVE)
|
run_params,
|
||||||
|
handle,
|
||||||
|
indent=4,
|
||||||
def np_encoder(self, object):
|
default=str,
|
||||||
if isinstance(object, np.generic):
|
number_mode=rapidjson.NM_NATIVE
|
||||||
return object.item()
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user