Skip to content

Commit a0b06f4

Browse files
committed
added exception if mode not supported
1 parent 34928a2 commit a0b06f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

yolox/core/trainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def step(self, value):
5757
improvement = 0 # avoid division by zero
5858
else:
5959
improvement = (value - self.best) / abs(self.best)
60+
else:
61+
raise ValueError(f"Unknown mode: {self.mode}, supported modes are 'max', 'min', 'percentage'.")
6062

6163
# Check if improvement is sufficient
6264
if improvement > self.min_delta:

0 commit comments

Comments
 (0)