Skip to content

Commit

Permalink
Update analysis_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
degiacom authored May 31, 2024
1 parent f34283b commit b775506
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/analysis_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@


def main():

# Note: running the code below within a function is necessary to ensure that
# multiprocessing (used to calculate DOPE and Ramachandran) runs correctly

print("> Loading network parameters...")

fname = f"xbb_foldingnet_checkpoints{os.sep}checkpoint_no_optimizer_state_dict_epoch167_loss0.003259085263643.ckpt"
Expand All @@ -15,8 +19,9 @@ def main():
checkpoint = torch.load(fname, map_location=device)
net = AutoEncoder(**checkpoint["network_kwargs"])
net.load_state_dict(checkpoint["model_state_dict"])

# the network is currently on CPU. If GPU is available, move it there
if torch.cuda.is_available():
# otherwise net is still not on the GPU
net.to(device)

print("> Loading training data...")
Expand Down

0 comments on commit b775506

Please sign in to comment.