Skip to content

Commit

Permalink
fix: error exporting when a gpu is available
Browse files Browse the repository at this point in the history
  • Loading branch information
Phaired committed Aug 20, 2024
1 parent 6a67f8a commit 15173b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ocrs_models/train_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def main():
raise Exception("ONNX export requires a checkpoint to load")

test_batch = next(iter(val_dataloader))
test_image = test_batch["image"][0:1]
test_image = test_batch["image"][0:1].to(device)

torch.onnx.export(
model,
Expand Down
2 changes: 1 addition & 1 deletion ocrs_models/train_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def main():
test_batch = next(iter(val_dataloader))
torch.onnx.export(
model,
test_batch["image"],
test_batch["image"].to(device),
args.export,
input_names=["line_image"],
output_names=["chars"],
Expand Down

0 comments on commit 15173b2

Please sign in to comment.