diff --git a/deepmd/driver.py b/deepmd/driver.py index 0b48f2ac84..998edcbc18 100644 --- a/deepmd/driver.py +++ b/deepmd/driver.py @@ -62,7 +62,8 @@ def label(self, data: dict) -> dict: atype = sorted_data["atom_types"] coord = data["coords"].reshape((nframes, natoms * 3)) - if "nopbc" not in data: + # sometimes data["nopbc"] may be False + if not data.get("nopbc", False): cell = data["cells"].reshape((nframes, 9)) else: cell = None