Skip to content

Commit ef4c94e

Browse files
committed
Improve lr schedule error message
1 parent a5f3adb commit ef4c94e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/textual_inversion/learn_schedule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class LearnScheduleIterator:
55
def __init__(self, learn_rate, max_steps, cur_step=0):
66
"""
7-
specify learn_rate as "0.001:100, 0.00001:1000, 1e-5:10000" to have lr of 0.001 until step 100, 0.00001 until 1000, 1e-5:10000 until 10000
7+
specify learn_rate as "0.001:100, 0.00001:1000, 1e-5:10000" to have lr of 0.001 until step 100, 0.00001 until 1000, and 1e-5 until 10000
88
"""
99

1010
pairs = learn_rate.split(',')
@@ -33,7 +33,7 @@ def __init__(self, learn_rate, max_steps, cur_step=0):
3333
return
3434
assert self.rates
3535
except (ValueError, AssertionError):
36-
raise Exception("Invalid learning rate schedule")
36+
raise Exception('Invalid learning rate schedule. It should be a number or, for example, like "0.001:100, 0.00001:1000, 1e-5:10000" to have lr of 0.001 until step 100, 0.00001 until 1000, and 1e-5 until 10000.')
3737

3838

3939
def __iter__(self):

0 commit comments

Comments
 (0)