-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
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
Reduce dnn top memory consumption #11461
Conversation
modules/dnn/src/caffe/caffe_io.cpp
Outdated
V1LayerParameter* layer_param) { | ||
const V1LayerParameter& v0_layer_connection = *v0_layer_connection_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static analyzers dislikes this (NULL pointer dereference):
- add pointer check before (
CV_Assert(ptr != NULL)
) - or revert pointer to reference (but this check should be added in caller).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alalek, It was just to reduce number of modified lines. So I replaced all the v0_layer_connection.
to v0_layer_connection->
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is the same: needed an assertion check or non-NULL guarantee before using of "->".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alalek, thanks, got it! Added it here and at UpgradeV1Net
and UpgradeV1LayerParameter
.
0f108ed
to
8f5a4e9
Compare
8f5a4e9
to
c99c3e7
Compare
Maximum resident size for a single image forward pass according to
/usr/bin/time --verbose
:current
PR
(PR vs. current)