Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aidge_export_tensorrt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nathan Thoumine
aidge_export_tensorrt
Commits
58fca115
Commit
58fca115
authored
1 year ago
by
Nathan Thoumine
Browse files
Options
Downloads
Patches
Plain Diff
Fix default calibration folder / cache
parent
3d3527a7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aidge_export_tensorrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
+1
-1
1 addition, 1 deletion
...orrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
aidge_export_tensorrt/static/tensorrt_8.6/src/Graph.cpp
+5
-4
5 additions, 4 deletions
aidge_export_tensorrt/static/tensorrt_8.6/src/Graph.cpp
with
6 additions
and
5 deletions
aidge_export_tensorrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
+
1
−
1
View file @
58fca115
...
...
@@ -26,7 +26,7 @@ void init_Graph(py::module& m)
.
def
(
"device"
,
&
Graph
::
device
,
py
::
arg
(
"id"
))
.
def
(
"load"
,
&
Graph
::
load
,
py
::
arg
(
"filepath"
))
.
def
(
"save"
,
&
Graph
::
save
,
py
::
arg
(
"filepath"
))
.
def
(
"calibrate"
,
&
Graph
::
calibrate
,
py
::
arg
(
"calibration_folder_path"
),
py
::
arg
(
"cache_file_path"
))
.
def
(
"calibrate"
,
&
Graph
::
calibrate
,
py
::
arg
(
"calibration_folder_path"
)
=
"./calibration_folder/"
,
py
::
arg
(
"cache_file_path"
)
=
"./calibration_chache"
)
.
def
(
"initialize"
,
&
Graph
::
initialize
)
.
def
(
"profile"
,
&
Graph
::
profile
,
py
::
arg
(
"nb_iterations"
),
py
::
arg
(
"mode"
)
=
ExecutionMode_T
::
ASYNC
)
.
def
(
"run_sync"
,
[](
Graph
&
graph
,
py
::
list
inputs
)
->
py
::
list
{
...
...
This diff is collapsed.
Click to expand it.
aidge_export_tensorrt/static/tensorrt_8.6/src/Graph.cpp
+
5
−
4
View file @
58fca115
...
...
@@ -112,10 +112,11 @@ void Graph::datamode(nvinfer1::DataType datatype)
break
;
}
}
void
Graph
::
calibrate
(
std
::
string
const
&
calibration_folder_path
,
std
::
string
const
&
cache_file_path
)
void
Graph
::
calibrate
(
std
::
string
const
&
calibration_folder_path
=
"./calibration_folder/"
,
std
::
string
const
&
cache_file_path
=
"./calibration_chache"
)
{
// Open calibration files
const
std
::
string
calibDir
=
calib
P
ath
;
const
std
::
string
calibDir
=
calib
ration_folder_p
ath
;
std
::
vector
<
std
::
string
>
filesCalib
;
struct
dirent
*
pFile
;
DIR
*
pDir
=
opendir
(
calibDir
.
c_str
());
...
...
@@ -149,8 +150,8 @@ void Graph::calibrate(std::string const& calibration_folder_path, std::string co
}
inputFile
.
close
();
BatchStream
calibrationStream
(
1
,
dims
[
0
],
dims
[
1
],
dims
[
2
],
nbCalibFiles
,
calib
P
ath
);
this
->
_calibrator
=
new
Int8EntropyCalibrator
(
calibrationStream
,
0
,
cache
P
ath
);
BatchStream
calibrationStream
(
1
,
dims
[
0
],
dims
[
1
],
dims
[
2
],
nbCalibFiles
,
calib
ration_folder_p
ath
);
this
->
_calibrator
=
new
Int8EntropyCalibrator
(
calibrationStream
,
0
,
cache
_file_p
ath
);
this
->
_builderconfig
->
setInt8Calibrator
(
this
->
_calibrator
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment