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

[fix] Make dataset iterator consistent train/train_single #1499

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix build_dataset_iter in train_single
  • Loading branch information
francoishernandez committed Jul 10, 2019
commit 2c9860b7337417912b0664fba344c1e7ab698169
6 changes: 5 additions & 1 deletion onmt/train_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def main(opt, device_id, batch_queue=None, semaphore=None):
train_shards.append(shard_base)
train_iter = build_dataset_iter_multiple(train_shards, fields, opt)
else:
train_iter = build_dataset_iter("train", fields, opt)
if opt.data_ids[0] is not None:
shard_base = "train_" + opt.data_ids[0]
else:
shard_base = "train"
train_iter = build_dataset_iter(shard_base, fields, opt)

else:
assert semaphore is not None, \
Expand Down