Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
e4a80aee
Commit
e4a80aee
authored
5 years ago
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #15296
parent
7c96857c
master
4.3.0
4.2.0
4.1.2
4.1.2-openvino
3.4.10
3.4.9
3.4.8
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+6
-7
test_tf_importer.cpp
modules/dnn/test/test_tf_importer.cpp
+1
-1
No files found.
modules/dnn/src/tensorflow/tf_importer.cpp
View file @
e4a80aee
...
...
@@ -1129,15 +1129,14 @@ void TFImporter::populateNet(Net dstNet)
if
(
value_id
.
find
(
layer
.
input
(
1
))
!=
value_id
.
end
())
{
Mat
newShape
=
getTensorContent
(
getConstBlob
(
layer
,
value_id
,
1
));
if
(
newShape
.
total
()
==
4
)
{
// NHWC->NCHW
std
::
swap
(
*
newShape
.
ptr
<
int32_t
>
(
0
,
2
),
*
newShape
.
ptr
<
int32_t
>
(
0
,
3
));
std
::
swap
(
*
newShape
.
ptr
<
int32_t
>
(
0
,
1
),
*
newShape
.
ptr
<
int32_t
>
(
0
,
2
));
}
if
(
inpLayout
==
DATA_LAYOUT_NHWC
)
{
if
(
newShape
.
total
()
==
4
)
{
// NHWC->NCHW
std
::
swap
(
*
newShape
.
ptr
<
int32_t
>
(
0
,
2
),
*
newShape
.
ptr
<
int32_t
>
(
0
,
3
));
std
::
swap
(
*
newShape
.
ptr
<
int32_t
>
(
0
,
1
),
*
newShape
.
ptr
<
int32_t
>
(
0
,
2
));
}
if
(
newShape
.
total
()
!=
4
||
newShape
.
at
<
int
>
(
1
)
==
1
)
{
LayerParams
permLP
;
...
...
This diff is collapsed.
Click to expand it.
modules/dnn/test/test_tf_importer.cpp
View file @
e4a80aee
...
...
@@ -279,7 +279,7 @@ TEST_P(Test_TensorFlow_layers, matmul)
// Reference output values are in range [-5.688, 4.484]
double
l1
=
target
==
DNN_TARGET_MYRIAD
?
6.1e-3
:
default_l1
;
runTensorFlowNet
(
"nhwc_reshape_matmul"
,
false
,
l1
);
runTensorFlowNet
(
"matmul_layout"
);
}
TEST_P
(
Test_TensorFlow_layers
,
reshape
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment