Commit 5bf3bc81 authored by Yuxin Wu's avatar Yuxin Wu

bug fix in pyzmq recv

parent a6a0889a
# tensorpack examples # tensorpack examples
Only allow examples with __reproducible__ and meaningful performancce. Examples with __reproducible__ and meaningful performancce.
+ [An illustrative mnist example](mnist-convnet.py) + [An illustrative mnist example](mnist-convnet.py)
+ [A small Cifar10 ConvNet with 91% accuracy](cifar-convnet.py) + [A small Cifar10 ConvNet with 91% accuracy](cifar-convnet.py)
......
...@@ -90,7 +90,7 @@ class SimulatorProcessStateExchange(SimulatorProcessBase): ...@@ -90,7 +90,7 @@ class SimulatorProcessStateExchange(SimulatorProcessBase):
c2s_socket.send(dumps( c2s_socket.send(dumps(
(self.identity, state, reward, isOver)), (self.identity, state, reward, isOver)),
copy=False) copy=False)
action = loads(s2c_socket.recv(copy=False)) action = loads(s2c_socket.recv(copy=False).bytes)
reward, isOver = player.action(action) reward, isOver = player.action(action)
state = player.current_state() state = player.current_state()
......
...@@ -96,7 +96,7 @@ class ILSVRC12(RNGDataFlow): ...@@ -96,7 +96,7 @@ class ILSVRC12(RNGDataFlow):
:param dir: A directory containing a subdir named `name`, where the :param dir: A directory containing a subdir named `name`, where the
original ILSVRC12_`name`.tar gets decompressed. original ILSVRC12_`name`.tar gets decompressed.
:param name: 'train' or 'val' or 'test' :param name: 'train' or 'val' or 'test'
:param dir_structure: The dir structure of 'val' or 'test'. :param dir_structure: The dir structure of 'val' and 'test'.
If is 'original' then keep the original decompressed dir with list If is 'original' then keep the original decompressed dir with list
of image files (as below). If equals to 'train', use the `train/` dir of image files (as below). If equals to 'train', use the `train/` dir
structure with class name as subdirectories. structure with class name as subdirectories.
......
...@@ -149,7 +149,7 @@ class PrefetchDataZMQ(ProxyDataFlow): ...@@ -149,7 +149,7 @@ class PrefetchDataZMQ(ProxyDataFlow):
for k in itertools.count(): for k in itertools.count():
if self._size > 0 and k >= self._size: if self._size > 0 and k >= self._size:
break break
dp = loads(self.socket.recv(copy=False)) dp = loads(self.socket.recv(copy=False).bytes)
yield dp yield dp
def reset_state(self): def reset_state(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment