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 (potential bug) in data module #234

Closed
gpengzhi opened this issue Oct 15, 2019 · 3 comments · Fixed by #249
Closed

A (potential bug) in data module #234

gpengzhi opened this issue Oct 15, 2019 · 3 comments · Fixed by #249
Assignees
Labels
bug Something isn't working enhancement New feature or request topic: data Issue about data loader modules

Comments

@gpengzhi
Copy link
Collaborator

gpengzhi commented Oct 15, 2019

Run seq2seq_attn example.

python prepare_data.py --data toy_copy

python seq2seq_attn.py --config-model config_model --config-data config_toy_copy

Have the following error. I believe there was no such error before.

step=0, loss=36.4250
step=50, loss=22.1697
step=100, loss=13.6045
step=150, loss=6.7436
step=200, loss=4.6603
step=250, loss=2.5102
step=300, loss=0.2983
Traceback (most recent call last):
  File "seq2seq_attn.py", line 180, in <module>
    main()
  File "seq2seq_attn.py", line 166, in main
    _train_epoch()
  File "seq2seq_attn.py", line 131, in _train_epoch
    for batch in data_iterator:
  File "/Users/pengzhi.gao/Desktop/my_git/texar-pytorch/texar/torch/data/data/data_iterators.py", line 426, in __next__
    not self.dataset.hparams.allow_smaller_final_batch):
AttributeError: '_SPDataLoaderIter' object has no attribute 'dataset'
@gpengzhi gpengzhi added bug Something isn't working topic: data Issue about data loader modules labels Oct 15, 2019
@huzecong
Copy link
Collaborator

Could you confirm which PyTorch version you're using? _SPDataLoaderIter is something we defined but only exists in PyTorch versions 1.2+, and it should be tested thoroughly in unit tests (SP stands for "single process" so it's indeed the most trivial case).

@huzecong
Copy link
Collaborator

huzecong commented Oct 15, 2019

Hmm, it's probably a compatibility issue with PyTorch 1.3. They've renamed variables in their data modules so everything is private and dataset became _dataset.

https://github.com/pytorch/pytorch/blob/30d9316f35cb1acab67e680ddc48279d84c7c6fe/torch/utils/data/dataloader.py#L302

I'm planning on rewriting the core code of data module so I might as well fix it with #225.

@gpengzhi
Copy link
Collaborator Author

Ah, I see. I think it is a compatibility issue with PyTorch 1.3.0.

@gpengzhi gpengzhi added enhancement New feature or request bug Something isn't working and removed bug Something isn't working labels Oct 15, 2019
@gpengzhi gpengzhi assigned gpengzhi and unassigned AvinashBukkittu Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request topic: data Issue about data loader modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants