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
9be3f7d4
Commit
9be3f7d4
authored
6 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11854 from dkurt:dnn_tf_data_layouts_v2
parents
f40231af
d971678a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+5
-4
No files found.
modules/dnn/src/tensorflow/tf_importer.cpp
View file @
9be3f7d4
...
...
@@ -51,7 +51,8 @@ enum DataLayout
{
DATA_LAYOUT_NHWC
,
DATA_LAYOUT_NCHW
,
DATA_LAYOUT_UNKNOWN
DATA_LAYOUT_UNKNOWN
,
DATA_LAYOUT_PLANAR
// 2-dimensional outputs (matmul, flatten, reshape to 2d)
};
typedef
std
::
vector
<
std
::
pair
<
String
,
int
>
>
StrIntVector
;
...
...
@@ -948,7 +949,7 @@ void TFImporter::populateNet(Net dstNet)
// one input only
int
input_blob_index
=
kernel_blob_index
==
0
?
1
:
0
;
connect
(
layer_id
,
dstNet
,
parsePin
(
layer
.
input
(
input_blob_index
)),
id
,
0
);
data_layouts
[
name
]
=
DATA_LAYOUT_
UNKNOWN
;
data_layouts
[
name
]
=
DATA_LAYOUT_
PLANAR
;
}
else
if
(
type
==
"Reshape"
)
{
...
...
@@ -981,7 +982,7 @@ void TFImporter::populateNet(Net dstNet)
// one input only
connect
(
layer_id
,
dstNet
,
inpId
,
id
,
0
);
data_layouts
[
name
]
=
DATA_LAYOUT_UNKNOWN
;
data_layouts
[
name
]
=
newShape
.
total
()
==
2
?
DATA_LAYOUT_PLANAR
:
DATA_LAYOUT_UNKNOWN
;
}
else
if
(
type
==
"Flatten"
||
type
==
"Squeeze"
)
{
...
...
@@ -1020,7 +1021,7 @@ void TFImporter::populateNet(Net dstNet)
int
id
=
dstNet
.
addLayer
(
name
,
"Flatten"
,
layerParams
);
layer_id
[
name
]
=
id
;
connect
(
layer_id
,
dstNet
,
inpId
,
id
,
0
);
data_layouts
[
name
]
=
DATA_LAYOUT_
UNKNOWN
;
data_layouts
[
name
]
=
DATA_LAYOUT_
PLANAR
;
}
else
if
(
type
==
"Transpose"
)
{
...
...
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