Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
266ce353
You need to sign in or sign up before continuing.
Commit
266ce353
authored
Jan 10, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update setup.py
parent
880b20e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
examples/ResNet/imagenet_utils.py
examples/ResNet/imagenet_utils.py
+3
-2
setup.py
setup.py
+2
-2
No files found.
examples/ResNet/imagenet_utils.py
View file @
266ce353
...
@@ -150,7 +150,7 @@ class ImageNetModel(ModelDesc):
...
@@ -150,7 +150,7 @@ class ImageNetModel(ModelDesc):
def
_build_graph
(
self
,
inputs
):
def
_build_graph
(
self
,
inputs
):
image
,
label
=
inputs
image
,
label
=
inputs
image
=
self
.
image_preprocess
(
image
,
bgr
=
True
)
image
=
ImageNetModel
.
image_preprocess
(
image
,
bgr
=
True
)
if
self
.
data_format
==
'NCHW'
:
if
self
.
data_format
==
'NCHW'
:
image
=
tf
.
transpose
(
image
,
[
0
,
3
,
1
,
2
])
image
=
tf
.
transpose
(
image
,
[
0
,
3
,
1
,
2
])
...
@@ -181,7 +181,8 @@ class ImageNetModel(ModelDesc):
...
@@ -181,7 +181,8 @@ class ImageNetModel(ModelDesc):
tf
.
summary
.
scalar
(
'learning_rate'
,
lr
)
tf
.
summary
.
scalar
(
'learning_rate'
,
lr
)
return
tf
.
train
.
MomentumOptimizer
(
lr
,
0.9
,
use_nesterov
=
True
)
return
tf
.
train
.
MomentumOptimizer
(
lr
,
0.9
,
use_nesterov
=
True
)
def
image_preprocess
(
self
,
image
,
bgr
=
True
):
@
staticmethod
def
image_preprocess
(
image
,
bgr
=
True
):
with
tf
.
name_scope
(
'image_preprocess'
):
with
tf
.
name_scope
(
'image_preprocess'
):
if
image
.
dtype
.
base_dtype
!=
tf
.
float32
:
if
image
.
dtype
.
base_dtype
!=
tf
.
float32
:
image
=
tf
.
cast
(
image
,
tf
.
float32
)
image
=
tf
.
cast
(
image
,
tf
.
float32
)
...
...
setup.py
View file @
266ce353
...
@@ -35,6 +35,6 @@ setup(
...
@@ -35,6 +35,6 @@ setup(
'all: python_version < "3.0"'
:
[
'tornado'
]
'all: python_version < "3.0"'
:
[
'tornado'
]
},
},
include_package_data
=
True
,
#
include_package_data=True,
package_data
=
{
'tensorpack'
:
[
'user_ops/Makefile'
,
'user_ops/*.cc'
,
'user_ops/*.h'
]},
#package_data={'tensorpack': [
]},
)
)
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