-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
32 lines (29 loc) · 934 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Trtexec.h"
EMoiLogger::Logger *emoiLogger = EMoiLogger::LoggerFactory::CreateConsoleLogger(EMoiLogger::INFO);
// ./Trtexec \
// --onnx model.onnx \
// --engine model.engine \
// --inputName "input" \
// --minShape 1x3x256x192 \
// --optShape 8x3x256x192 \
// --maxShape 32x3x256x192 \
// --workspace 1024
// --dynamicOnnx
int main(int argc, char **argv)
{
OnnxParserConfig config;
if (ParseCommandLine(argc, argv, config))
{
std::unique_ptr<TrtExec> executor = std::make_unique<TrtExec>(config);
std::cout << config << std::endl;
// if (config.dynamic)
{
executor->parseOnnxModel();
executor->saveEngine(config.engine_dir);
}
ELOG(INFO) << "[ PASSED ]:\n"
<< config << std::endl;
}
else
ELOG(ERROR) << "[ ERROR ] STOP!!!" << std::endl;
}