Unverified Commit fccb1091 authored by Jiazhen Wang's avatar Jiazhen Wang Committed by GitHub
Browse files

Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

parent c1de4c9b
......@@ -213,6 +213,8 @@ def imfrombytes(content, flag='color', channel_order='bgr', backend=None):
Args:
content (bytes): Image bytes got from files or other streams.
flag (str): Same as :func:`imread`.
channel_order (str): The channel order of the output, candidates
are 'bgr' and 'rgb'. Default to 'bgr'.
backend (str | None): The image decoding backend type. Options are
`cv2`, `pillow`, `turbojpeg`, `tifffile`, `None`. If backend is
None, the global imread_backend specified by ``mmcv.use_backend()``
......
......@@ -109,7 +109,7 @@ class TextLoggerHook(LoggerHook):
def _get_max_memory(self, runner):
device = getattr(runner.model, 'output_device', None)
mem = torch.cuda.max_memory_allocated(device=device)
mem_mb = torch.tensor([mem / (1024 * 1024)],
mem_mb = torch.tensor([int(mem) // (1024 * 1024)],
dtype=torch.int,
device=device)
if runner.world_size > 1:
......
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