You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try convert pytorch model to ONNX and get next error- RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 3
Here is model and weights ExampleColorNet.zip Link to weights
My code
import os
import argparse
from PIL import Image
import numpy as np
import cv2
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torch.onnx
import torch.nn as nn
from ExampleColorNet import ExampleColorNet
ic =13
color_net = ExampleColorNet(ic)
test_model = 'ExampleColorNet.pth'
color_net.load_state_dict(torch.load(test_model, map_location=lambda storage, loc: storage))
color_net.eval()
torch.onnx.export(color_net, torch.rand(32,13,3,3), "ExampleColorNet.onnx")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I try convert pytorch model to ONNX and get next error- RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 3
Here is model and weights
ExampleColorNet.zip
Link to weights
My code
Beta Was this translation helpful? Give feedback.
All reactions