Dive into the world of Data Analytics – uncover insights, explore trends, and master data-driven decision making.
Admin: @HusseinSheikho || @Hussein_Sheikho
Post #3452
146
DA @dataanalyticsx
pip install torch onnx onnxruntime
.onnx file, and immediately performs a verification of the output.import torch, torch.nn as nn, onnxruntime as ort, numpy as np
model = nn.Sequential(nn.Linear(10, 5), nn.ReLU())
x = torch.randn(1, 10)
torch.onnx.export(model, x, "model.onnx", input_names=["input"], output_names=["output"])
session = ort.InferenceSession("model.onnx")
res = session.run(None, {"input": x.numpy()})
print("ONNX Output shape:", res[0].shape)
python3 -c "import onnx; model = onnx.load('model.onnx'); onnx.checker.check_model(model); print('ONNX Model Status: Valid')"rm -f model.onnx
Forwarded from Machine Learning with Python

Forwarded from Machine Learning with Python




Forwarded from Machine Learning
pandas_vs_polars_cheatsheet.png1.1 MBForwarded from Machine Learning with Python

Forwarded from Machine Learning with Python


Forwarded from Machine Learning with Python
This post (sticker, poll or similar) has no web preview. Open in Telegram
