Skip to content

Commit

Permalink
Using with stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
maldil authored Aug 7, 2022
1 parent 4f120f9 commit c8311a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions body/human_pose/ambiguity_aware/lib/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def init_weights(model):
m.bias.data.zero_()

def save_pickle(data, save_path):
f = open(save_path, "wb")
pkl.dump(data, f)
f.close()
with open(save_path, "wb") as f:
pkl.dump(data, f)
print(f"=> saved to {save_path}")

def load_pickle(load_path):
Expand Down

0 comments on commit c8311a4

Please sign in to comment.