From 028b7cdb5a2e650b4d9e79eaa90a00c1efdcbcba Mon Sep 17 00:00:00 2001 From: Michael Ben ami <31584614+mbenami@users.noreply.github.com> Date: Thu, 1 Dec 2022 22:44:14 +0200 Subject: [PATCH] fix_reading_nan_in_evolve (#10358) when there is `nan` in evolve.csv pandas read it as str remove the space before fix that Signed-off-by: Michael Ben ami <31584614+mbenami@users.noreply.github.com> Signed-off-by: Michael Ben ami <31584614+mbenami@users.noreply.github.com> Co-authored-by: Glenn Jocher --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index c5b7389..efe8590 100644 --- a/utils/general.py +++ b/utils/general.py @@ -1036,7 +1036,7 @@ def print_mutation(keys, results, hyp, save_dir, bucket, prefix=colorstr('evolve # Save yaml with open(evolve_yaml, 'w') as f: - data = pd.read_csv(evolve_csv) + data = pd.read_csv(evolve_csv, skipinitialspace=True) data = data.rename(columns=lambda x: x.strip()) # strip keys i = np.argmax(fitness(data.values[:, :4])) # generations = len(data)