Troubles I met when trying to update docs
See original GitHub issueI ran tools/update_doc.sh to update the docs.
I found
-
(solved by myself in #2478) The version of ONNX schema version has been updated to 11, however, the onnx model has not been uploaded. For example, https://s3.amazonaws.com/download.onnx/models/opset_11/bvlc_alexnet.tar.gz is an invaild url.
When running
tools/update_doc.sh, the urls indata.jsonare edited to opset 11 (link and link), and are loaded in link. As a result, the process of updating docs cannot succeed.The download will be skipped if there are already models of the same name on the disk. This could be the reason why the problem got ignored. However, this problem prevents new contributors from contributing to ONNX.
-
(Solved by myself in #2050) The script echoes “Please run this script in the ONNX root folder” when “onnx/defs/gen_doc.py” exists.
-
(Solved by myself in #2050) The script runs
python setup.py developwithout--user. So the script can only be run as a root user. It’s not the best practice. What’s more, the script will create or edit many files, and they will be all owned by root. As a result, the regular user cannot delete, edit or git add them anymore without running chown manually. -
(Unsolved) I got the following error when running onnx/defs/gen_doc.py.
Traceback (most recent call last): File “/home/daquexian/repos/onnx/onnx/defs/gen_doc.py”, line 350, in <module> main(Args) File “/home/daquexian/repos/onnx/onnx/defs/gen_doc.py”, line 240, in main s += display_schema(schema, [schema]) File “/home/daquexian/repos/onnx/onnx/defs/gen_doc.py”, line 196, in display_schema type_constraint.type_param_str, allowedTypeStr) UnboundLocalError: local variable ‘allowedTypeStr’ referenced before assignment
After digging into it, I found a strange thing
Python 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import onnx >>> a=onnx.defs.get_all_schemas_with_history()[1] >>> a.type_constraints[0].allowed_type_strs ['tensor(float)', 'tensor(double)', 'tensor(int64)', 'tensor(int32)'] >>> a.type_constraints[0].allowed_type_strs [] >>> a.inputs[0].name 'X' >>> a.inputs[0].name ''It is this strange thing that causes the above error. However I don’t know the reason. It only happens when installing onnx by
python setup.py installbut not installing wheel from pypi. I validated it on both python 3.7 and python 3.6.
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (19 by maintainers)

Top Related StackOverflow Question
What’s more, I always have a mess of diff on the generated models after running
./tools/update_doc.sh(screenshot from sublime merge):I believe not only me are suffering from these problems. I’m very curious that how did other people propose their PRs
I am taking a look… got same issue reported earlier