ort
ort copied to clipboard
RuntimeError: Error in execution: At least one output should be requested.
Getting this error with pretty simple model. This is direct error from ONNX, but I couldn’t find any methods to register output in ORTInferenceModule
Versions: torch Version: 1.12.1 onnx Version: 1.12.0 torch-ort-infer Version: 1.12.0
Reproduction steps:
import torch
from torch import nn
from torch_ort import ORTInferenceModule, OpenVINOProviderOptions
class Block(nn.Module):
def __init__(self, size):
super().__init__()
self.size = size
self.ff1 = nn.Linear(size, size)
def forward(self, x):
second = self.ff1(x)
return second
model = Block(1024)
model.eval()
model = ORTInferenceModule(model, provider_options=OpenVINOProviderOptions(backend="CPU", precision="FP32"))
with torch.inference_mode():
print("start")
x = torch.randn(1, 1024, dtype=torch.float32)
x = model(x)
print(x.mean())