Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
efd1bfe5
Commit
efd1bfe5
authored
Apr 10, 2017
by
Konstantin Lopuhin
Committed by
Soumith Chintala
Apr 10, 2017
Browse files
Fix inception v3 input transform (#144)
First dimension is batch size, channel is the second
parent
3549aefc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/models/inception.py
torchvision/models/inception.py
+3
-3
No files found.
torchvision/models/inception.py
View file @
efd1bfe5
...
@@ -70,9 +70,9 @@ class Inception3(nn.Module):
...
@@ -70,9 +70,9 @@ class Inception3(nn.Module):
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
if
self
.
transform_input
:
if
self
.
transform_input
:
x
=
x
.
clone
()
x
=
x
.
clone
()
x
[
0
]
=
x
[
0
]
*
(
0.229
/
0.5
)
+
(
0.485
-
0.5
)
/
0.5
x
[
:,
0
]
=
x
[
:,
0
]
*
(
0.229
/
0.5
)
+
(
0.485
-
0.5
)
/
0.5
x
[
1
]
=
x
[
1
]
*
(
0.224
/
0.5
)
+
(
0.456
-
0.5
)
/
0.5
x
[
:,
1
]
=
x
[
:,
1
]
*
(
0.224
/
0.5
)
+
(
0.456
-
0.5
)
/
0.5
x
[
2
]
=
x
[
2
]
*
(
0.225
/
0.5
)
+
(
0.406
-
0.5
)
/
0.5
x
[
:,
2
]
=
x
[
:,
2
]
*
(
0.225
/
0.5
)
+
(
0.406
-
0.5
)
/
0.5
# 299 x 299 x 3
# 299 x 299 x 3
x
=
self
.
Conv2d_1a_3x3
(
x
)
x
=
self
.
Conv2d_1a_3x3
(
x
)
# 149 x 149 x 32
# 149 x 149 x 32
...
...
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