Got error with upsampling operation
See original GitHub issuemy implementation is below…
import onnx
from onnx import helper
from onnx import TensorProto
import numpy as np
data = np.array([[[
    [1, 2],
    [3, 4],
]]], dtype=np.float32)
scales = np.array([1.0, 1.0, 2.0, 3.0], dtype=np.float32)
inputs = list()
input_tensor = helper.make_tensor_value_info(
    'x', TensorProto.FLOAT, data.shape)
scale_tensor = helper.make_tensor_value_info(
    'scales', TensorProto.FLOAT, (4,))
inputs.append(input_tensor)
inputs.append(scale_tensor)
initializers = list()
initializers.append(helper.make_tensor('scales', TensorProto.FLOAT, scales.shape, scales))
graph = helper.make_graph(
            nodes=[helper.make_node("Upsample", ['x', 'scales'], ['y'])],
            name='UPSAMPLE-TEST',
            inputs=inputs,
            outputs=[],
            initializer=initializers)
model_def = helper.make_model(graph)
onnx.checker.check_model(model_def)
and I got the output
onnx.onnx_cpp2py_export.checker.ValidationError: Input size 2 not in range [min=1, max=1].
==> Context: Bad node spec: input: "x" input: "scales" output: "y" op_type: "Upsample"
I can’t understand error message…any hint? Thanks!
my onnx version is 1.3.0 with python 2.7.15.
Issue Analytics
- State:
 - Created 5 years ago
 - Reactions:1
 - Comments:15
 
Top Results From Across the Web
Getting error while performing upsampling of an audio signal ...
I am using the following modules from start recording to stop recording and open recording of .wav file. import numpy as np import...
Read more >The Upsampling operation is not supported when convert ...
When converting a Mxnet model which uses mx.symbol.UpSampling operation, there is an error occurred.
Read more >Processing aware image filtering: compensating for the ...
This post summarizes some thoughts and experiments on "filtering aware image filtering" I've been doing for a while. The core idea is simple ......
Read more >Upsample VI - NI - National Instruments
The length of Upsampled Array is the upsampling factor times the length of X. error returns any error or warning from the VI....
Read more >Upsampling and Downsampling - CCRMA
The window is hopped by N samples, but recall that it is operating on input date time aliased by the factor. L/N, where...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@xxradon Very nice, THX.
meet this error with ubuntu16.04+python3.5.2+pytorch1.3+onnx1.6…
could we solve this without build onnx from source code?
i wanna move my model to trt6…