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

TypeError: '>' not supported between instances of 'str' and 'int' #46

Open
rGitcy opened this issue Sep 13, 2023 · 1 comment
Open

TypeError: '>' not supported between instances of 'str' and 'int' #46

rGitcy opened this issue Sep 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rGitcy
Copy link

rGitcy commented Sep 13, 2023

hi~
i meet the error, TypeError: '>' not supported between instances of 'str' and 'int'. The error img is:
image

This is my script:
import numpy
import onnx_tool
#from onnx_tool import create_ndarray_f16 # or use numpy.ones(shape,numpy.float32) is ok
def create_ndarray_fp16(shape):
return numpy.ones(shape, dtype=numpy.float16)

modelpath = '/home/young.ruan/mode_analyze/onnxfiles/alpaca-onnx-7B-fp16/models/decoder-merge-0.onnx'
m = onnx_tool.Model(modelpath)
inputs = {'hidden_in': create_ndarray_fp16((1, 1, 4096)), 'attn_mask': create_ndarray_fp16((1, 1, 1, 32)),
'position_ids': create_ndarray_fp16((1, 1)), 'past_key_in': create_ndarray_fp16((1, 32, 31, 128)),
'past_value_in': create_ndarray_fp16((1, 32, 31, 128))}
m.graph.shape_infer(inputs)
m.graph.profile()
m.graph.print_node_map()
m.save_model('decoder-0_fp16_shapes.onnx')

Thanks for your help.

@ThanatosShinji
Copy link
Owner

did you miss any input tensor? it seems one tensor's shape is a str value.

@ThanatosShinji ThanatosShinji added the bug Something isn't working label Sep 13, 2023
@ThanatosShinji ThanatosShinji self-assigned this Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants