Commit 076cdd6c authored by Kai Chen's avatar Kai Chen
Browse files

support pytorch 1.0

parent a097c65f
......@@ -54,7 +54,7 @@ def imfrombytes(content, flag='color'):
Returns:
ndarray: Loaded image array.
"""
img_np = np.fromstring(content, np.uint8)
img_np = np.frombuffer(content, np.uint8)
flag = imread_flags[flag] if is_str(flag) else flag
img = cv2.imdecode(img_np, flag)
return img
......
......@@ -33,7 +33,7 @@ class MMDistributedDataParallel(nn.Module):
self._dist_broadcast_coalesced(module_states,
self.broadcast_bucket_size)
if self.broadcast_buffers:
buffers = [b.data for b in self.module._all_buffers()]
buffers = [b.data for b in self.module.buffers()]
if len(buffers) > 0:
self._dist_broadcast_coalesced(buffers,
self.broadcast_bucket_size)
......
......@@ -13,7 +13,7 @@ def get_host_info():
def get_dist_info():
if dist._initialized:
if dist.is_initialized():
rank = dist.get_rank()
world_size = dist.get_world_size()
else:
......
__version__ = '0.2.0'
__version__ = '0.2.2'
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