-
Notifications
You must be signed in to change notification settings - Fork 10
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
Import ONNX model from pytorch - LDense only works over 2D tensors (LDense) #340
Comments
Which version of the EDDL are you using? In theory, we support n-dimensional dense layers since the last version 1.1b, which is on par with the latest PyEDDL version (1.3.*) |
I pulled the most recent version from the main branch. The input the neural network takes is no multi-dimensional tensor - it is only an array with four floats. Is there Is there another way to import a neural network? Would it be feasible to import the weights of a neural network using the function eddl::set_parameters? Is there a detailed description of its functionality in the docu? |
If you are using the last version, the n-dense should work. Anyway, could you send me the onnx file to take a look and debug it? |
Sure - it would be great if you could have a look at it. It seems I can't add the file directly - so I compress it into a zip file. Hope it works ... |
Dear Florian, Salva and myself have been working on the code of the EDDL to find the cause of the error. The error is generated when importing from ONNX if the shape of the input layer(s) has only one dimension. The EDDL always assumes the first component of the shape is the batch_size. We corrected the problem with the C++ version with a provisional patch for checking whether the shape of input layers has only one dimension, then using it as the size of the input layer. At least for the purpose of UC7 from the FRACTAL project, it runs OK now only in C++. |
Great, this are good news.- thanks for the information. So, I just have to pull the most recent eddl version from github to get the patch, right?
BR, Florian
…________________________________________
Von: Jon Ander Gómez Adrián ***@***.***
Gesendet: Montag, 10. Oktober 2022 23:17
An: deephealthproject/eddl
Cc: Thaler, Florian (0610xxx); Author
Betreff: Re: [deephealthproject/eddl] Import ONNX model from pytorch - LDense only works over 2D tensors (LDense) (Issue #340)
Dear Florian,
Salva and myself have been working on the code of the EDDL to find the cause of the error.
The error is generated when importing from ONNX if the shape of the input layer(s) has only one dimension. The EDDL always assumes the first component of the shape is the batch_size. We corrected the problem with the C++ version with a provisional patch for checking whether the shape of input layers has only one dimension, then using it as the size of the input layer.
At least for the purpose of UC7 from the FRACTAL project, it runs OK now only in C++.
—
Reply to this email directly, view it on GitHub<#340 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AK5UXWGDBDPZZQQQM7ZCQJ3WCSBWDANCNFSM6AAAAAAQ245FBQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hello.
I trained a model (using dense layers only) in stable-baselines, which I would like to include into an EDDL project. For this reason I imported the model in pytorch, which allows me to export the model in onnx format. When importing and building the onnx model in eddl I encounter the following error:
For the sake of reproducibility I post the codes of a dummy example down below.
The definition of the stable-baselines model and the conversion to pytorch, and onnx (versions: onnx == 1.9.0, torch == 1.10.1, stable-baselines == 2.10.0):
The C++ integration:
As I found, a similar issue was already discussed in #328.
The text was updated successfully, but these errors were encountered: