Comments (3)
UnsupportedOperatorError: Exporting the operator 'aten::select_backward' to ONNX opset version 17 is not supported
I mean, sounds like you're gonna have a bad time, because ONNX's operator set is insufficient for backwards/training
from pytorch.
That's quite strange because this self contained example
import torch
import onnxruntime as ort
import numpy as np
class F(torch.nn.Module):
def forward(self, X):
y = X.square().sum()
return torch.autograd.grad(y, X, create_graph=True, retain_graph=True)
f = F()
X = torch.arange(3).to(torch.float32)
X.requires_grad_(True)
test_out = f(X)
print(test_out)
X2 = torch.arange(3).to(torch.float32)
X2.requires_grad_(True)
torch.onnx.export(f, X2,'test.onnx', input_names=['X'],
output_names=['out'])
inArray = np.arange(3).astype(np.float32)
ort_sess = ort.InferenceSession('test.onnx')
outputs = ort_sess.run(None, {'X': inArray})
print("input:", inArray)
print("output:", outputs[0])
also uses autograd and tracks the gradient, and runs absolutely fine. I'm not sure I understand why it works fine tracking a scalar with autograd.grad, but fails when it comes to the multivariate jacobian.
from pytorch.
I mean, how complicated your backward graph is depends on your model. If you're lucky you'll hit everything in the onnx opset. But we have some pretty strange backward ops and onnx doesn't always have full coverage.
from pytorch.
Related Issues (20)
- Investigate alternatives to remove mask from triton sort kernel
- `test_dummy_mha_with_nt_cuda` fails on `sm70`, `sm75` HOT 4
- Dynamo export: unsupported FX node 'aten.expm1.default' HOT 4
- Error: CUDA error: CUDA_ERROR_INVALID_VALUE cuMemcpyDtoH failed with Halide GPU Backend HOT 2
- Dynamo export: Fake tensor broadcast error HOT 2
- UNSTABLE trunk / linux-focal-cuda11.8-py3.10-gcc9-experimental-split-build-test / test (distributed) HOT 2
- UNSTABLE trunk / linux-focal-cuda11.8-py3.10-gcc9-experimental-split-build-test / test (distributed) HOT 1
- UNSTABLE trunk / linux-focal-cuda11.8-py3.10-gcc9-experimental-split-build-test / test (distributed) HOT 1
- How to Convert pytorch qat model to tensorrt HOT 1
- [AOTI] AttributeError: 'ShapeAsConstantBuffer' object has no attribute 'dtype'
- RVV support in PyTorch HOT 2
- Libtorch 2.3.1 requires Glibc_2.28 and can't be used on ubuntu 18. HOT 4
- my accuracy is not increasing HOT 1
- Support for 5-D output image tensors in `Col2Im`. HOT 1
- ChainedScheduler fail on CosineAnnealingWarmRestarts
- OSError: [WinError 126] The specified module could not be found. Error loading "\.venv\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies. HOT 1
- scaled_dot_product_attention fails on Ampere arch with head_dim > 128 HOT 2
- dynamo should recompile when a tensor subclass's inner tensor changes HOT 1
- torch._dynamo.exc.Unsupported: call_method NNModuleVariable() state_dict [] {}
- [custom_op] torch.library.define should be able to auto-infer schema.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.