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
b01cd6d9
Commit
b01cd6d9
authored
Mar 07, 2020
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error for wrong param dtype
parent
e2eba742
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
docs/tutorial/inference.md
docs/tutorial/inference.md
+3
-2
tensorpack/callbacks/param.py
tensorpack/callbacks/param.py
+4
-0
tensorpack/dataflow/imgaug/convert.py
tensorpack/dataflow/imgaug/convert.py
+1
-1
tensorpack/input_source/input_source.py
tensorpack/input_source/input_source.py
+1
-1
No files found.
docs/tutorial/inference.md
View file @
b01cd6d9
...
...
@@ -152,8 +152,9 @@ with TowerContext('', is_training=False):
It's also very common to change the graph for inference.
For example, you may need a different data layout for CPU inference,
or you may need placeholders in the inference graph (which may not even exist in
the training graph). However metagraph is not designed to be easily modified at all.
you may need placeholders in the inference graph (which may not even exist in
the training graph), you may add/remove static shapes for inference, etc.
However metagraph is not designed to be easily modified at all.
Due to the above reasons, to do inference, it's best to recreate a clean graph (and save it if needed) by yourself.
```
...
...
tensorpack/callbacks/param.py
View file @
b01cd6d9
...
...
@@ -77,6 +77,10 @@ class GraphVarParam(HyperParam):
def
set_value
(
self
,
v
):
""" Assign the variable a new value. """
if
not
self
.
var
.
dtype
.
is_floating
and
isinstance
(
v
,
float
):
raise
ValueError
(
"HyperParam {} has type '{}'. Cannot update it using float values."
.
format
(
self
.
name
,
self
.
var
.
dtype
))
self
.
var
.
load
(
v
)
def
get_value
(
self
):
...
...
tensorpack/dataflow/imgaug/convert.py
View file @
b01cd6d9
...
...
@@ -44,7 +44,7 @@ class Grayscale(ColorSpace):
class
ToUint8
(
PhotometricAugmentor
):
""" Convert image to uint8. Useful to reduce communication overhead. """
""" C
lip and c
onvert image to uint8. Useful to reduce communication overhead. """
def
_augment
(
self
,
img
,
_
):
return
np
.
clip
(
img
,
0
,
255
)
.
astype
(
np
.
uint8
)
...
...
tensorpack/input_source/input_source.py
View file @
b01cd6d9
...
...
@@ -134,7 +134,7 @@ class FeedfreeInput(InputSource):
class
EnqueueThread
(
ShareSessionThread
):
def
__init__
(
self
,
queue
,
ds
,
placehdrs
):
super
(
EnqueueThread
,
self
)
.
__init__
()
self
.
name
=
'EnqueueThread
'
+
queue
.
name
self
.
name
=
'EnqueueThread
: enqueue dataflow to TF queue "{}"'
.
format
(
queue
.
name
)
self
.
daemon
=
True
self
.
dataflow
=
ds
self
.
queue
=
queue
...
...
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