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

incomplete captions generated! #94

Open
Monikshah opened this issue Feb 26, 2024 · 1 comment
Open

incomplete captions generated! #94

Monikshah opened this issue Feb 26, 2024 · 1 comment

Comments

@Monikshah
Copy link

I ran your test.py file, and printed the gen (generated caption), there are so many captions that are incomplete sentences such as:

  • "a desk with two computer monitors and a laptop on a"
  • "a traffic light in front of a building with a"

I am not sure if this is the case. Cam you please let me know why I am getting many incomplete sentences as generated caption using this model?

Thank you!

@thalapandi
Copy link

Type of dataset attribute: <class 'main.PairedDataset'>
collate_fn is callable.
Length of train dataloader: 35403
Length of validation dataloader: 1563
Length of test dataloader: 313
Is collate_fn callable? True

TypeError Traceback (most recent call last)
in <cell line: 74>()
72 print("Is collate_fn callable?", callable(dataloader_train.dataset.collate_fn))
73
---> 74 for it, (images, captions) in enumerate(dataloader_train):
75 try:
76 print("Iteration:", it)

2 frames
/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py in next(self)
629 # TODO(pytorch/pytorch#76750)
630 self._reset() # type: ignore[call-arg]
--> 631 data = self._next_data()
632 self._num_yielded += 1
633 if self._dataset_kind == _DatasetKind.Iterable and \

/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py in _next_data(self)
673 def _next_data(self):
674 index = self._next_index() # may raise StopIteration
--> 675 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
676 if self._pin_memory:
677 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device)

/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index)
47 if self.auto_collation:
48 if hasattr(self.dataset, "getitems") and self.dataset.getitems:
---> 49 data = self.dataset.getitems(possibly_batched_index)
50 else:
51 data = [self.dataset[idx] for idx in possibly_batched_index]

TypeError: 'generator' object is not callable

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

2 participants