Comments (1)
Hi,
If you want to use the model with a "low_mem" configuration, you should say it in the constructor of the CompServ. The argument "mem" of the ONNX import function is not valid for doing that, and we will probably remove this argument in the future.
You can see the example using the CompServ here:
#include <iostream>
#include "eddl/apis/eddl.h"
#include "eddl/serialization/onnx/eddl_onnx.h"
using namespace eddl;
int main(int argc, char **argv) {
auto resnet101 = import_net_from_onnx_file("resnet101.onnx", { 3, 224, 224 }, 0);
auto resnet101_low_mem = import_net_from_onnx_file("resnet101.onnx", { 3, 224, 224 }, 0); // <- Use 0
auto conv = dynamic_cast<LConv*>(resnet101->layers[1]);
auto conv_low_mem = dynamic_cast<LConv*>(resnet101_low_mem->layers[1]);
build(resnet101,
adam(),
{"softmax_cross_entropy"},
{"categorical_accuracy"},
CS_CPU(-1, "full_mem")); // <- "full_mem"
build(resnet101_low_mem,
adam(),
{"softmax_cross_entropy"},
{"categorical_accuracy"},
CS_CPU(-1, "low_mem")); // <- "low_mem"
eddl_free(conv->cd->ptrI);
cout << "Conv ptrI freed" << endl;
eddl_free(conv_low_mem->cd->ptrI); // Now the program doesn't break
cout << "Conv_low_mem ptrI freed" << endl;
return EXIT_SUCCESS;
}
And regarding your last question, you can import the model and then use any configuration that you want, it just changes the amount of memory reserved for the operations, but the results should be the same.
from eddl.
Related Issues (20)
- Fallback of unsupported args for ONNX
- Load dynamic inputs shapes from ONNX
- Add Tile layer and Broadcast HOT 1
- Allow asymmetric padding in ONNX
- Add the name_id of each layer
- Different training results with Keras and EDDL
- The examples should be intendeed for begineers, not for testing internals.
- Avoid printing to standard output HOT 1
- Support n-dimensional dense HOT 1
- Add preprocessor directives for FPGA
- Download model params are not consistent with keras.
- Problem in deserialization of an ONNX model HOT 1
- Segmentation fault in eddl.forward() with a LSTM layer HOT 3
- non-recurrent LSTM cells with multiple GPUs HOT 1
- Import ONNX file with a different input channel dimension HOT 1
- LSTM training fail on single GPU, but not with multiple GPUs HOT 4
- Export to ONNX randomly fails HOT 9
- Import ONNX model from pytorch - LDense only works over 2D tensors (LDense) HOT 6
- Tensor manipulations HOT 9
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 eddl.