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
e6bd7188
Commit
e6bd7188
authored
May 04, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TENSORPACK_SERIALIZE (#746)
parent
3dd7171d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
CHANGES.md
CHANGES.md
+1
-1
examples/A3C-Gym/simulator.py
examples/A3C-Gym/simulator.py
+2
-2
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+2
-1
No files found.
CHANGES.md
View file @
e6bd7188
...
...
@@ -9,7 +9,7 @@ Here are a list of things that were changed, starting from an early version.
TensorFlow itself also changed APIs before 1.0 and those are not listed here.
+
[2018/04/05] msgpack is replaced by pyarrow. If you want compatibility with old serialized data,
manually uninstall pyarrow, and msgpack will be used as a fallback
.
`export TENSORPACK_SERIALIZE=msgpack`
.
+
[2018/03/20]
`ModelDesc`
starts to use simplified interfaces:
+
`_get_inputs()`
renamed to
`inputs()`
and returns
`tf.placeholder`
s.
+
`build_graph(self, tensor1, tensor2)`
returns the cost tensor directly.
...
...
examples/A3C-Gym/simulator.py
100644 → 100755
View file @
e6bd7188
...
...
@@ -87,7 +87,7 @@ class SimulatorProcessStateExchange(SimulatorProcessBase):
c2s_socket
.
send
(
dumps
(
(
self
.
identity
,
state
,
reward
,
isOver
)),
copy
=
False
)
action
=
loads
(
s2c_socket
.
recv
(
copy
=
False
)
.
bytes
)
action
=
loads
(
s2c_socket
.
recv
(
copy
=
False
))
state
,
reward
,
isOver
,
_
=
player
.
step
(
action
)
if
isOver
:
state
=
player
.
reset
()
...
...
@@ -144,7 +144,7 @@ class SimulatorMaster(threading.Thread):
self
.
clients
=
defaultdict
(
self
.
ClientState
)
try
:
while
True
:
msg
=
loads
(
self
.
c2s_socket
.
recv
(
copy
=
False
)
.
bytes
)
msg
=
loads
(
self
.
c2s_socket
.
recv
(
copy
=
False
))
ident
,
state
,
reward
,
isOver
=
msg
client
=
self
.
clients
[
ident
]
if
client
.
ident
is
None
:
...
...
tensorpack/utils/serialize.py
100644 → 100755
View file @
e6bd7188
...
...
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# File: serialize.py
import
os
from
.develop
import
create_dummy_func
__all__
=
[
'loads'
,
'dumps'
]
...
...
@@ -61,7 +62,7 @@ except ImportError:
dumps_msgpack
=
create_dummy_func
(
# noqa
'dumps_msgpack'
,
[
'msgpack'
,
'msgpack_numpy'
])
if
pa
is
None
:
if
pa
is
None
or
os
.
environ
.
get
(
'TENSORPACK_SERIALIZE'
,
None
)
==
'msgpack'
:
loads
=
loads_msgpack
dumps
=
dumps_msgpack
else
:
...
...
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