We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b25de1 commit 4625b34Copy full SHA for 4625b34
library/train_util.py
@@ -957,8 +957,11 @@ def make_buckets(self):
957
self.bucket_info["buckets"][i] = {"resolution": reso, "count": len(bucket)}
958
logger.info(f"bucket {i}: resolution {reso}, count: {len(bucket)}")
959
960
- img_ar_errors = np.array(img_ar_errors)
961
- mean_img_ar_error = np.mean(np.abs(img_ar_errors))
+ if len(img_ar_errors) == 0:
+ mean_img_ar_error = 0 # avoid NaN
962
+ else:
963
+ img_ar_errors = np.array(img_ar_errors)
964
+ mean_img_ar_error = np.mean(np.abs(img_ar_errors))
965
self.bucket_info["mean_img_ar_error"] = mean_img_ar_error
966
logger.info(f"mean ar error (without repeats): {mean_img_ar_error}")
967
0 commit comments