Skip to content

Commit db6aa3c

Browse files
committed
fix: special case of single frame dataset
1 parent 0b3dfc8 commit db6aa3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

deepmd/utils/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def _get_nframes(self, set_name: DPPath) -> int:
606606
shape, fortran_order, dtype = np.lib.format.read_array_header_2_0(f)
607607
else:
608608
raise ValueError(f"Unsupported .npy file version: {version}")
609-
nframes = shape[0]
609+
nframes = shape[0] if (len(shape) if isinstance(shape, tuple) else 0) > 1 else 1
610610
return nframes
611611

612612
def reformat_data_torch(self, data: dict[str, Any]) -> dict[str, Any]:

0 commit comments

Comments
 (0)