未验证 提交 617c2dec 编写于 作者: Y Yan Chunwei 提交者: GitHub

bugfix/image get sample out of range (#136)

上级 971578c6
......@@ -6,6 +6,7 @@ from tempfile import NamedTemporaryFile
import numpy as np
from PIL import Image
from log import logger
def get_modes(storage):
......@@ -102,20 +103,23 @@ def get_image_tag_steps(storage, mode, tag):
shape = record.shape()
# TODO(ChunweiYan) remove this trick, some shape will be empty
if not shape: continue
# assert shape, "%s,%s" % (mode, tag)
query = urllib.urlencode({
'sample': 0,
'index': step_index,
'tag': origin_tag,
'run': mode,
})
res.append({
'height': shape[0],
'width': shape[1],
'step': record.step_id(),
'wall_time': image.timestamp(step_index),
'query': query,
})
try:
query = urllib.urlencode({
'sample': 0,
'index': step_index,
'tag': origin_tag,
'run': mode,
})
res.append({
'height': shape[0],
'width': shape[1],
'step': record.step_id(),
'wall_time': image.timestamp(step_index),
'query': query,
})
except:
logger.error("image sample out of range")
return res
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册