Traceback (most recent call last):


 "train.py", line 25, in <module>

for i, data in enumerate(dataset):


 "/data/zzj/APDrawingGAN-master/data/__init__.py", line 72, in __iter__

for i, data in enumerate(self.dataloader):


 "/home/zzj/.conda/envs/th1.1/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in __next__

return self._process_next_batch(batch)


 "/home/zzj/.conda/envs/th1.1/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch

raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):

Traceback (most recent call last):


 "train.py", line 406, in <module>

main()


 "train.py", line 402, in main

train_model(model, fields, optim, data_type, model_opt)


 "train.py", line 228, in train_model

valid_stats = trainer.validate(valid_iter)


 "/home/moses/pytorchwork/OpenNMT-py/onmt/Trainer.py", line 246, in validate

for batch in valid_iter:


 "train.py", line 129, in __iter__

for batch in self.cur_iter:


 "/usr/local/lib/python3.5/dist-packages/torchtext/data/iterator.py", line 162, in __iter__

self.init_epoch()


 "/usr/local/lib/python3.5/dist-packages/torchtext/data/iterator.py", line 140, in init_epoch

self.create_batches()


 "/home/moses/pytorchwork/OpenNMT-py/onmt/io/IO.py", line 337, in create_batches

self.batch_size_fn):


 "/usr/local/lib/python3.5/dist-packages/torchtext/data/iterator.py", line 274, in batch

size_so_far = batch_size_fn(ex, len(minibatch), size_so_far)
TypeError: 'NoneType' object is not callable
