diff --git a/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py b/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py index 783810be64..de997529de 100644 --- a/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py +++ b/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py @@ -682,7 +682,9 @@ def main(): if args.push_to_hub: repo.push_to_hub(commit_message="End of training", auto_lfs_prune=True) - all_results = {f"eval_{k}": v for k, v in eval_metrics.items()} + all_results = { + f"eval_{k}": v.tolist() if isinstance(v, np.ndarray) else v for k, v in eval_metrics.items() + } with open(os.path.join(args.output_dir, "all_results.json"), "w") as f: json.dump(all_results, f)