Commit 12d51ccd authored by Yuxin Wu's avatar Yuxin Wu

fix LMDBDataPoint bug from #267

parent 5ae5f3e5
...@@ -157,19 +157,16 @@ class LMDBDataDecoder(MapData): ...@@ -157,19 +157,16 @@ class LMDBDataDecoder(MapData):
class LMDBDataPoint(MapData): class LMDBDataPoint(MapData):
""" Read a LMDB file and produce deserialized values. """ Read a LMDB file and produce deserialized datapoints.
This can work with :func:`tensorpack.dataflow.dftools.dump_dataflow_to_lmdb`. """ It reads the database produced by
:func:`tensorpack.dataflow.dftools.dump_dataflow_to_lmdb`.
"""
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
""" """
Args: Args:
args, kwargs: Same as in :class:`LMDBData`. args, kwargs: Same as in :class:`LMDBData`.
""" """
if isinstance(args[0], LMDBData):
ds = args[0]
else:
ds = LMDBData(*args, **kwargs)
def f(dp): def f(dp):
return loads(dp[1]) return loads(dp[1])
super(LMDBDataPoint, self).__init__(ds, f) super(LMDBDataPoint, self).__init__(ds, f)
......
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