Skip to content

Commit 2cb3163

Browse files
Copilotnjzjz
andcommitted
fix: remove unnecessary try/except around h5py import
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
1 parent 8e731c8 commit 2cb3163

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

deepmd/tf/entrypoints/train.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
Optional,
1414
)
1515

16-
try:
17-
import h5py
18-
except ImportError:
19-
h5py = None
16+
import h5py
2017

2118
from deepmd.common import (
2219
j_loader,
@@ -249,8 +246,6 @@ def _do_work(
249246

250247
if not Path(stat_file_raw).exists():
251248
if stat_file_raw.endswith((".h5", ".hdf5")):
252-
if h5py is None:
253-
raise ImportError("h5py is required for HDF5 stat files")
254249
with h5py.File(stat_file_raw, "w") as f:
255250
pass
256251
else:

0 commit comments

Comments
 (0)