Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About an issue encountered in running the command line "python -m onnx_tool ......" #83

Open
xwentian2020 opened this issue Jun 15, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@xwentian2020
Copy link

Describe the bug
In running the command line "python -m onnx_tool -i 'resnet50-v1-12.onnx' -o 'resnet50_shapes.onnx'", the info promoted there was something unexpected, listed as follows.

PS H:\AIModels> python -m onnx_tool -i 'resnet50-v1-12.onnx' -o 'resnet50_shapes.onnx'
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "G:\onnx-tool\sd_env\Lib\site-packages\onnx_tool_main
.py", line 93, in
onnx_tool.model_profile(args.in
, dynamic, save_profile=args.file, save_model=args.out)
File "G:\onnx-tool\sd_env\Lib\site-packages\onnx_tool_init_.py", line 84, in model_profile
g.shape_infer(dynamic_shapes)
File "G:\onnx-tool\sd_env\Lib\site-packages\onnx_tool\graph.py", line 974, in shape_infer
raise ValueError(
ValueError: The input tensor data's shape [N,3,224,224] is not valid, Please set it to a valid shape.

Any suggestions for solving the above issue?

@xwentian2020
Copy link
Author

xwentian2020 commented Jun 15, 2024

The model used in the above command line can be found in https://hf-mirror.com/webai-community/models/tree/main. The Python libs installer are as follows.

PS H:\AIModels> pip list -v
Package    Version Location                              Installer
---------- ------- ------------------------------------- ---------
numpy      1.26.4  G:\onnx-tool\sd_env\Lib\site-packages pip      
onnx       1.16.1  G:\onnx-tool\sd_env\Lib\site-packages pip      
onnx-tool  0.9.0   G:\onnx-tool\sd_env\Lib\site-packages pip      
pip        24.0    G:\onnx-tool\sd_env\Lib\site-packages pip      
protobuf   5.27.1  G:\onnx-tool\sd_env\Lib\site-packages pip      
setuptools 65.5.0  G:\onnx-tool\sd_env\Lib\site-packages pip      
tabulate   0.9.0   G:\onnx-tool\sd_env\Lib\site-packages pip    

@ThanatosShinji
Copy link
Owner

ValueError: The input tensor data's shape [N,3,224,224] is not valid, Please set it to a valid shape.

you should specify a fixed input shape for your model

@ThanatosShinji ThanatosShinji added the help wanted Extra attention is needed label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants