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

KeyError: u'height_scale' #33

Open
ischihmo opened this issue Apr 30, 2020 · 8 comments
Open

KeyError: u'height_scale' #33

ischihmo opened this issue Apr 30, 2020 · 8 comments

Comments

@ischihmo
Copy link

ischihmo commented Apr 30, 2020

Hi,thank you very much for this tool.

I want to do a conversion from pytorch to caffe.

My settings are as follow:

onnx 1.6.0(pip install onnx)
pytorch 0.4.0
protobuf 2.6.1
python 2.7.17

There is no error in running test.py

root@ubuntn:/home/merz/onnx/onnx2caffe-master# python convertCaffe.py hourglass.onnx hourglass.prototxt hourglass.caffemodel
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:537] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:78] The total number of bytes read was 765562426
Traceback (most recent call last):
  File "convertCaffe.py", line 108, in <module>
    convertToCaffe(graph, prototxt_path, caffemodel_path)
  File "convertCaffe.py", line 55, in convertToCaffe
    layer = converter_fn(node,graph,err)
  File "/home/merz/onnx/onnx2caffe-master/onnx2caffe/_operators.py", line 277, in _convert_upsample
    factor = int(node.attrs["height_scale"])
KeyError: u'height_scale'

What should I do with this error?
Please guide me.

@CangHaiQingYue
Copy link

hi, did you fix this bug?

@ischihmo
Copy link
Author

ischihmo commented Jul 9, 2020

@CangHaiQingYue 搞不定,放弃了

@Eliza-and-black
Copy link

I meet the issue when run 'convertCaffe.py', and it links to " _convert_resize",
factor = int(node.attrs["height_scale"]) KeyError: u'height_scale'
What should I do?

@Eliza-and-black
Copy link

I think it might comes from pytorch2onnx,when I set torch.onnx.export to opset_version=9,this error disappear. @CangHaiQingYue

@CangHaiQingYue
Copy link

Thanks a lot!@Eliza-and-black

@CangHaiQingYue
Copy link

@CangHaiQingYue 搞不定,放弃了
我直接写死了

@Eliza-and-black
Copy link

@CangHaiQingYue 搞不定,放弃了
我直接写死了

Do you mean that you let factor=2?

@CangHaiQingYue
Copy link

@CangHaiQingYue 搞不定,放弃了
我直接写死了

Do you mean that you let factor=2?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants