question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got error with upsampling operation

See original GitHub issue

my 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

1reaction
lyuwenyucommented, Dec 18, 2018

@xxradon Very nice, THX.

0reactions
allenlingcommented, Dec 4, 2019

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found