[Bug] [Relax][ONNX] MaxUnpool calls tolist on its output_shape expression
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu từ bộ chuyển đổi MaxUnpool của frontend ONNX trong Relax, nơi total_output_shape được lấy từ inputs[2] và .tolist() được gọi trên đó. Chạy script tái hiện với explicit_shape đặt là True để gặp lỗi AttributeError với GenericConst. Hoàn thành khi trường hợp output_shape tường minh import được và khớp với kết quả [[[[5, 0], [0, 0]]]] của ReferenceEvaluator cho cả mô hình hai đầu vào lẫn mô hình ba đầu vào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected behavior
Providing the optional constant output_shape=[1, 1, 2, 2] should preserve the result of the equivalent two-input MaxUnpool.
Actual behavior
The two-input model imports. Adding the same explicit output shape passes ONNX full checking and reference evaluation, then fails during import:
AttributeError: 'GenericConst' object has no attribute 'tolist'
The converter assigns inputs[2] to total_output_shape and calls .tolist() on that Relax expression.
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.array([[[[5.0]]]], dtype="float32")
for explicit_shape in [False, True]:
initializers = [nh.from_array(np.zeros((1, 1, 1, 1), dtype="int64"), "indices")]
inputs = ["x", "indices"]
if explicit_shape:
initializers.append(nh.from_array(np.array([1, 1, 2, 2], dtype="int64"), "shape"))
inputs.append("shape")
node = h.make_node("MaxUnpool", inputs, ["y"], kernel_shape=[2, 2], strides=[2, 2])
model = h.make_model(h.make_graph([node], "unpool",
[h.make_tensor_value_info("x", T.FLOAT, [1, 1, 1, 1])],
[h.make_tensor_value_info("y", T.FLOAT, [1, 1, 2, 2])], initializers),
opset_imports=[h.make_opsetid("", 18)], ir_version=10)
onnx.checker.check_model(model, full_check=True)
expected = np.array([[[[5, 0], [0, 0]]]], dtype="float32")
np.testing.assert_array_equal(ReferenceEvaluator(model).run(None, {"x": x})[0], expected)
try:
from_onnx(model, keep_params_in_input=False)
print("explicit_shape", explicit_shape, "imported")
except Exception as error:
print("explicit_shape", explicit_shape, type(error).__name__, str(error).splitlines()[-1])
Triage
- needs-triage
- Ngôn ngữ chính
- Python
- Star
- 13.9k
- Fork
- 4k
- Merge trung bình
- 8 giờ 6 phút
- Pull request đã merge (30 ngày)
- 184
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/tvm
-
needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [Relax][ONNX] OneHot does not convert floating-point depth to int64Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởneeds-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug][Relax] ReorderTakeAfterMatmul fails on vector dot productsCó thể đã có người làm @hiyufan đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
apache/tvm#20595 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Server mode OAuth2: 'NoneType' object is not subscriptable on every request after re-submitting the OAuth2 login while already logged inCó thể đã có người làm @Rarasinhoo đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
pgadmin-org/pgadmin4#10733 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws-samples/sample-per-model-bedrock#752 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
int-brain-lab/mpci#32 ·
-
docs(api): add sesmax-core as a layer below radtrax and sesmax-ocean in the dependency graphĐang mởarea:docs priority:p2 type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jejjohnson/geostack#120 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
sublimelsp/LSP-vue#203 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày