anibali / margipose

3D monocular human pose estimation
Apache License 2.0
98 stars 20 forks source link

Fix tensor to int conversion warning during ONNX export tracing #10

Open jaggernaut007 opened 4 years ago

anibali commented 4 years ago

For future reference, this PR fixes the following warning during tracing for ONNX model export:

Converting a tensor to a Python integer 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!

However, due to https://github.com/pytorch/pytorch/issues/27551 this change can't be made until we upgrade to PyTorch 1.5.0 otherwise tracing (and hence ONNX export) breaks completely.