Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A torch.utils.data.Dataset demo #71

Open
jinyu121 opened this issue Mar 31, 2018 · 4 comments
Open

A torch.utils.data.Dataset demo #71

jinyu121 opened this issue Mar 31, 2018 · 4 comments

Comments

@jinyu121
Copy link

Hi~

Look at this~ https://gist.github.com/jinyu121/02a505bb2547006ceb3fdbba3bee556c

Works fine (certainly) to me

@longcw
Copy link
Owner

longcw commented Apr 26, 2018

For anyone who wants to use this dataloader, you can move imdb.parse to collate_fn and convert numpy array to tensor. Then the data processing part will run on multiple processes, and the data will be shared on the memeroy by using tensor.
Another solution is to move _im_processor to __get_item__.

@jinyu121 jinyu121 changed the title A torch.utils.data.Dataset A torch.utils.data.Dataset demo Apr 29, 2018
@ztyxd
Copy link

ztyxd commented Jul 10, 2018

@jinyu121 this web https://gist.github.com/jinyu121/02a505bb2547006ceb3fdbba3bee556c may loss
efficacy. Can u give me another web please? I really want to konw how to use the torch.utils.data.Dataset instead of multiprocessing

@hixiaye
Copy link

hixiaye commented Oct 17, 2018

For anyone who wants to use this dataloader, you can move imdb.parse to collate_fn and convert numpy array to tensor. Then the data processing part will run on multiple processes, and the data will be shared on the memeroy by using tensor.
Another solution is to move _im_processor to __get_item__.

Hi, I don't understand what the move imdb.parsetocollate_fn meaning. And where I should convert numpy array to tensor? Could you give me some advices? thx

@hixiaye
Copy link

hixiaye commented Oct 17, 2018

Hi~

Look at this~ https://gist.github.com/jinyu121/02a505bb2547006ceb3fdbba3bee556c

Works fine (certainly) to me

Hi, I don't understand what the move imdb.parsetocollate_fn meaning. And where I should convert numpy array to tensor? Could you give me some advices? thx

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

No branches or pull requests

4 participants