Skip to content

Commit

Permalink
executed notebooks with new model
Browse files Browse the repository at this point in the history
  • Loading branch information
malteprinzler committed Nov 16, 2020
1 parent b361627 commit 7090a3a
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 64 deletions.
Binary file added MISC/matching_examples/jeans.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
274 changes: 240 additions & 34 deletions notebooks/attribute_prediction.ipynb

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions notebooks/product_matching.ipynb

Large diffs are not rendered by default.

Binary file modified notebooks/ref_attr_scores.pth
Binary file not shown.
15 changes: 6 additions & 9 deletions python_code/export_checkpoint_to_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ def export2sas(argstring=None):
# print(summary(model, input_size=(3, 512, 512), device="cpu"))

input_sample = torch.rand((1, 3, 512, 512))
# model.to_onnx(output_path, input_sample, export_params=True, input_names=["input"], output_names=["output"],
# dynamic_axes={"input": {0: 'batch_size'}, "output": {0: "batch_size"}})
model.to_onnx(output_path, input_sample, export_params=True)
model.to_onnx(output_path, input_sample, export_params=True, input_names=["input"], output_names=["output"],
dynamic_axes={"input": {0: 'batch_size'}, "output": {0: "batch_size"}})

print(f"Exported Model successfully to {output_path}")


if __name__ == "__main__":
if len(sys.argv) <= 1:
source_file = "../lightning_logs/version_7064773/checkpoints/epoch=3.ckpt"
outfile = "../exports/attr_pred_model.onnx"
export2sas(f"-c {source_file} -o {outfile}")
else:
export2sas()
export2sas()

0 comments on commit 7090a3a

Please sign in to comment.