Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Python list as a gluon Dataset #12087

Closed
asitstands opened this issue Aug 8, 2018 · 1 comment · Fixed by #12093
Closed

Python list as a gluon Dataset #12087

asitstands opened this issue Aug 8, 2018 · 1 comment · Fixed by #12093

Comments

@asitstands
Copy link
Contributor

asitstands commented Aug 8, 2018

data = mx.gluon.data.DataLoader([([1,2], 0), ([3, 4], 1)], batch_size=1, num_workers=2) 
for d, l in data:
    pass

This causes an error in the recent master.

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/site-packages/mxnet-1.3.0-py3.6.egg/mxnet/gluon/data/dataloader.py", line 154, in worker_loop
    dataset._fork()
AttributeError: 'list' object has no attribute '_fork'

The code has worked in some days ago. I guess #11370 brokes it. According to the API doc, any types with __getitem__ and __len__ can be used as a Dataset. #11370 is temporal but I think it would be a good idea to avoid breaking existing code. @zhreshold

@lanking520
Copy link
Member

@mxnet-label-bot could you please add [gluon, bug] to this label?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants