MiniGPT-4 icon indicating copy to clipboard operation
MiniGPT-4 copied to clipboard

RuntimeError: probability tensor contains either `inf`, `nan` or element < 0

Open le-wei opened this issue 1 year ago • 3 comments

Describe the bug When deploying MiniGPT-v2, I encountered the following error while running the example:

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app. Exception in thread Thread-8: Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/threading.py", line 980, in _bootstrap_inner self.run() File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/threading.py", line 917, in run self._target(*self._args, **self._kwargs) File "/home/ubuntu/objectData/MiniGPT-4/minigpt4/conversation/conversation.py", line 207, in model_generate output = self.model.llama_model.generate(*args, **kwargs) File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/site-packages/peft/peft_model.py", line 580, in generate return self.base_model.generate(**kwargs) File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate return self.sample( File "/home/ubuntu/anaconda3/envs/miniGpt/lib/python3.9/site-packages/transformers/generation/utils.py", line 2655, in sample next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1) RuntimeError: probability tensor contains either inf, nan or element < 0

Screenshots image image

Desktop (please complete the following information):

  • OS: [e.g.Ubuntu 20.4]
  • Browser [e.g. chrome]
  • Version [e.g. 22]

Additional context image image

Please help me, thank you.

le-wei avatar Nov 15 '23 08:11 le-wei

this has never happens to us before when the batch size=1. Does this happen frequently from your side?

junchen14 avatar Nov 15 '23 18:11 junchen14

I have been encountering this issue constantly and have not yet succeeded in deducing the cause. I am not sure if there is a problem with my configuration, or from what aspect I should troubleshoot. Thank you very much for your reply.

le-wei avatar Nov 16 '23 06:11 le-wei

did you solve it yet?

ChaosPengs avatar Jan 02 '24 09:01 ChaosPengs