We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b3dfc8 commit db6aa3cCopy full SHA for db6aa3c
1 file changed
deepmd/utils/data.py
@@ -606,7 +606,7 @@ def _get_nframes(self, set_name: DPPath) -> int:
606
shape, fortran_order, dtype = np.lib.format.read_array_header_2_0(f)
607
else:
608
raise ValueError(f"Unsupported .npy file version: {version}")
609
- nframes = shape[0]
+ nframes = shape[0] if (len(shape) if isinstance(shape, tuple) else 0) > 1 else 1
610
return nframes
611
612
def reformat_data_torch(self, data: dict[str, Any]) -> dict[str, Any]:
0 commit comments