We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fa2fbe commit ce7fe95Copy full SHA for ce7fe95
deepmd/utils/data.py
@@ -603,7 +603,7 @@ def _get_nframes(self, set_name: DPPath) -> int:
603
shape, fortran_order, dtype = np.lib.format.read_array_header_2_0(f)
604
else:
605
raise ValueError(f"Unsupported .npy file version: {version}")
606
- nframes = shape[0]
+ nframes = shape[0] if (len(shape) if isinstance(shape, tuple) else 0) > 1 else 1
607
return nframes
608
609
def reformat_data_torch(self, data: dict[str, Any]) -> dict[str, Any]:
0 commit comments