Skip to content

Commit c224e80

Browse files
committed
fix when valid data is not avail
1 parent 3417fe3 commit c224e80

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

deepmd/pt/train/training.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ def get_opt_param(params):
162162
def cycle_iterator(iterable: Iterable):
163163
"""
164164
Produces an infinite iterator by repeatedly cycling through the given iterable.
165-
165+
166166
Args:
167167
iterable (Iterable): The iterable to cycle through.
168-
168+
169169
Yields:
170170
Any: The next item from the iterable, cycling back to the beginning when the end is reached.
171171
"""
@@ -1083,7 +1083,8 @@ def get_data(self, is_train=True, task_key="Default"):
10831083
iterator = self.validation_data
10841084
if self.multi_task:
10851085
iterator = iterator[task_key]
1086-
1086+
if iterator is None:
1087+
return {}, {}, {}
10871088
batch_data = next(iterator)
10881089
for key in batch_data.keys():
10891090
if key == "sid" or key == "fid" or key == "box" or "find_" in key:

0 commit comments

Comments
 (0)