[Bug] [Relax][ONNX] Resize drops axes-scoped sizes before constructing resize2d
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 65/100
Línea de trabajo
Start from the Resize converter in the Relax ONNX frontend, where sizes[2:] is sliced without applying the axes mapping. Run the provided repro.py to confirm the ValueError for axes=[2, 3] while full-rank sizes still import. Done when the axes-scoped case yields a 2-dim size and the output matches the full-rank result [1, 1, 4, 4].
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected behavior
For Resize-18, axes=[2, 3], sizes=[4, 4] on a [1, 1, 2, 2] tensor should produce the same [1, 1, 4, 4] result as full-rank sizes=[1, 1, 4, 4].
Actual behavior
Full-rank sizes import successfully. Axes-scoped sizes pass ONNX full checking and the ONNX reference evaluation, but fail during Relax import:
ValueError: Resize2D expects the given output image size to be a 2-dim shape, while the given one has ndim 0
The converter slices sizes[2:] without expanding the axes mapping. This uses the default stretch policy; the aspect-ratio change in #20846 does not cover it.
Environment
TVM 0.28.dev0 (local build; build commit unavailable), Python 3.12.3, Linux x86_64; ONNX 1.22.0, NumPy 2.5.4.
Steps to reproduce
Run with python repro.py:
import numpy as np
import onnx
from onnx import TensorProto as T, helper as h, numpy_helper as nh
from onnx.reference import ReferenceEvaluator
from tvm.relax.frontend.onnx import from_onnx
x = np.arange(4, dtype="float32").reshape(1, 1, 2, 2)
expected = x.repeat(2, axis=2).repeat(2, axis=3)
for axes, sizes in [(None, [1, 1, 4, 4]), ([2, 3], [4, 4])]:
attrs = {} if axes is None else {"axes": axes}
node = h.make_node("Resize", ["x", "", "", "sizes"], ["y"],
mode="nearest", coordinate_transformation_mode="asymmetric",
nearest_mode="floor", **attrs)
model = h.make_model(h.make_graph([node], "resize",
[h.make_tensor_value_info("x", T.FLOAT, [1, 1, 2, 2])],
[h.make_tensor_value_info("y", T.FLOAT, [1, 1, 4, 4])],
[nh.from_array(np.array(sizes, dtype="int64"), "sizes")]),
opset_imports=[h.make_opsetid("", 18)], ir_version=10)
onnx.checker.check_model(model, full_check=True)
np.testing.assert_array_equal(ReferenceEvaluator(model).run(None, {"x": x})[0], expected)
try:
from_onnx(model, keep_params_in_input=False)
print("axes", axes, "imported")
except Exception as error:
print("axes", axes, type(error).__name__, str(error).splitlines()[-1])
Triage
- needs-triage
- Lenguaje dominante
- Python
- Estrellas
- 13.9k
- Forks
- 4k
- Merge medio
- 8 h 5 min
- PR fusionados (30 d)
- 170
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/tvm
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
[Bug] [Relax][ONNX] OneHot does not convert floating-point depth to int64Posiblemente ocupada @tandede la tomó hace 2 días. Abiertoneeds-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Bug][Relax] ReorderTakeAfterMatmul fails on vector dot productsPosiblemente ocupada @hiyufan la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/tvm#20595 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/tvm
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
didi/helixharness#18 ·
-
[MOVIE]: Airport '77 (1977)Abiertorequest-theme
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
LizardByte/ThemerrDB#9883 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#149885 ·
Los mantenedores suelen responder en 1 día
-
Set cache_ok = True on GUID TypeDecorator to enable SQLAlchemy query cachingPosiblemente ocupada @patelshivani2283-lab la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
fedora-infra/anitya#2157 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Project-MONAI/MONAI#9258 ·
Los mantenedores suelen responder en 3 días