Closed FlorianThaler closed 1 year ago
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.
We only support onnx for IO, although you could indeed try to load the weights "manually" using set_parameters
.
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 GitHubhttps://github.com/deephealthproject/eddl/issues/340#issuecomment-1273829029, or unsubscribehttps://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.