rs export: Failed to export an ONNX attribute
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Bắt đầu với robosat/tools/export.py, đặc biệt là lệnh gọi torch.onnx.export được hiển thị trong traceback, và tái hiện lệnh rs export đã cung cấp với checkpoint và cấu hình dataset được liệt kê. Truy vết lỗi thuộc tính ONNX qua đường dẫn export; hoàn tất khi lệnh export thành công model mà không gặp RuntimeError được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi All!
I've been experimenting with this framework the past few weeks with great success -- thanks to all who have worked on this tool.
I've run into an issue with the rs export command that looks like it may be an underlying library issue? I've tried it on the releasedbavaria-dop80-checkpoint.pth as well as a few of my own and they all produce the following error:
docker run --name exporter --rm -it -v /home/mmester/robosat-tanzania-19/data:/data -v /home/mmester/robosat-tanzania-19/config:/config mapbox/robosat:latest-cpu export /data/checkpoints/onnx.pb --dataset /config/dataset-building-mapbox.toml --image_size 512 --checkpoint /data/checkpoints/checkpoint-00050-of-00050.pth
/usr/src/app/robosat/unet.py:120: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
assert size[-1] % 32 == 0 and size[-2] % 32 == 0, "image resolution has to be divisible by 32 for resnet"
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/src/app/robosat/tools/__main__.py", line 58, in <module>
args.func(args)
File "/usr/src/app/robosat/tools/export.py", line 40, in main
torch.onnx.export(net, batch, args.model)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/__init__.py", line 25, in export
return utils.export(*args, **kwargs)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/utils.py", line 131, in export
strip_doc_string=strip_doc_string)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/utils.py", line 363, in _export
_retain_param_name, do_constant_folding)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/utils.py", line 278, in _model_to_graph
_disable_torch_constant_prop=_disable_torch_constant_prop)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/utils.py", line 188, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/__init__.py", line 50, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/utils.py", line 589, in _run_symbolic_function
return fn(g, *inputs, **attrs)
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in wrapper
args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in <listcomp>
args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
File "/opt/venv/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 90, in _parse_arg
raise RuntimeError("Failed to export an ONNX attribute, "
RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible
My dataset.config:
# Configuration related to a specific dataset.
# For syntax see: https://github.com/toml-lang/toml#table-of-contents
# Dataset specific common attributes.
[common]
# Image side size in pixels.
image_size = 256
# The slippy map dataset's base directory.
dataset = "/data/mapbox"
# Human representation for classes.
classes = ['background', 'building']
# Color map for visualization and representing classes in masks.
# Note: available colors can be found in `robosat/colors.py`
colors = ['denim', 'orange']
# Dataset specific class weights computes on the training data.
# Needed by 'mIoU' and 'CrossEntropy' losses to deal with unbalanced classes.
# Note: use `./rs weights -h` to compute these for new datasets.
[weights]
values = [1.570984, 7.152249]
Any debugging suggestions or potential fixes would be greatly appreciated!
- Ngôn ngữ chính
- Python
- Star
- 2.1k
- Fork
- 384
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 mapbox/robosat
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
-
Bringin own dataĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Tất cả issue của mapbox/robosat
Issue tương tự
-
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Groundskeeper-robot/groundskeeper#248 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`pull` silently ignores unknown service names and exits 0Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
containers/podman-compose#1640 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
debpalash/VoiceStudio#4550 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fundamentals step:6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
voantony/OpenCourtVision#244 ·
Maintainer thường phản hồi trong vòng 1 ngày