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

ValueError: max() arg is an empty sequence #191

Open
loserlulin9 opened this issue Feb 15, 2023 · 3 comments
Open

ValueError: max() arg is an empty sequence #191

loserlulin9 opened this issue Feb 15, 2023 · 3 comments

Comments

@loserlulin9
Copy link

I encounter with a bug which is "ValueError: max() arg is an empty sequence" when I run caption.py. I find that the parameter complete_inds and complete_seqs_scores is null during the process. Is this due to my checkpoint model? Could anyone help me? Thanks!!!
image

@AndreiMoraru123
Copy link

AndreiMoraru123 commented Feb 15, 2023

Well, it's empty, so there are no complete sequences. You could catch it with an if to add the last incomplete sequence:

if len(complete_seqs) == 0:
   complete_seqs.extend(seqs.tolist())  # (s, step+1)
   complete_seqs_alpha.extend(seqs_alpha.tolist())
   complete_seqs_scores.extend(top_k_scores.tolist())  # (s)

That did it for me

@loserlulin9
Copy link
Author

Thank u so much! It works! Wish u have a nice day!

Well, it's empty, so there are no complete sequences. You could catch it with an if to add the last incomplete sequence:

if len(complete_seqs) == 0:
   complete_seqs.extend(seqs.tolist())  # (s, step+1)
   complete_seqs_alpha.extend(seqs_alpha.tolist())
   complete_seqs_scores.extend(top_k_scores.tolist())  # (s)

That did it for me

@tigerbrother222
Copy link

I also,but not solve it

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

3 participants