-
Notifications
You must be signed in to change notification settings - Fork 27.4k
[ONNX]RuntimeError: Unexpected node type: onnx::Cast #47182
Copy link
Copy link
Closed
Labels
module: onnxRelated to torch.onnxRelated to torch.onnxneeds reproductionEnsure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.Ensure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
❓convert faild
class Decoder(nn.Module):
def __init__(self, N, L):
super(Decoder, self).__init__()
# Hyper-parameter
self.N, self.L = N, L
# Components
self.basis_signals = nn.Linear(N, L, bias=False)
def forward(self, mixture_w, est_mask):
"""
Args:
mixture_w: [M, N, K]
est_mask: [M, C, N, K]
Returns:
est_source: [M, C, T]
"""
# D = W * M
source_w = torch.unsqueeze(mixture_w, 1) * est_mask # [M, C, N, K]
source_w = torch.transpose(source_w, 2, 3) # [M, C, K, N]
# S = DV
est_source = self.basis_signals(source_w) # [M, C, K, L]
est_source = overlap_and_add(est_source, self.L // 2) # M x C x T
return est_sourceThis is the model which I converted. It has two inputs, and it's a Linear NN. As I know onnx.export support mutiple inputs.
So I convert it with the following code:
model = ConvTasNet.load_model(args.model_path)
model.eval()
Decoder = model.decoder
torch.onnx.export(Decoder, (separator_input, decoder_input),
decoder_path,
export_params=True )
But I got this error.
RuntimeError: Unexpected node type: onnx::Cast
Further information
Pytorch 1.7
cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
module: onnxRelated to torch.onnxRelated to torch.onnxneeds reproductionEnsure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.Ensure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module