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

Tensor.item() cannot be called on meta tensors #21

Open
sowbug opened this issue Oct 24, 2024 · 0 comments
Open

Tensor.item() cannot be called on meta tensors #21

sowbug opened this issue Oct 24, 2024 · 0 comments

Comments

@sowbug
Copy link

sowbug commented Oct 24, 2024

Ubuntu 24.04, Python 3.11. Put some test images in input/ and ran python batch-alpha2.py in venv after following setup steps, and I get this output:

$ python batch-alpha2.py
2024-10-24 00:40:59,151 INFO: Arguments: Namespace(glob=None, filelist=None, input_folder=False, prompt='Please provide a detailed description of the image.', prompt_file=None, image_seq_length=1, batch_size=1, greedy=False, temperature=0.5, top_p=0.9, top_k=10, max_new_tokens=300, num_workers=4, model='fancyfeast/llama-joycaption-alpha-two-hf-llava', print_captions=False, print_captioning_status=False, overwrite=True, prepend_string='', append_string='')
2024-10-24 00:40:59,151 INFO: No image sources provided. Defaulting to the 'input' folder.
2024-10-24 00:40:59,151 INFO: Adding 57 images from the default input folder '[...]/input'.
2024-10-24 00:40:59,151 INFO: Total images found: 57
2024-10-24 00:40:59,151 INFO: Overwrite option enabled; all images will be processed.
2024-10-24 00:41:00,367 INFO: We will use 90% of the memory on device 0 for storing the model, and 10% for the buffer to avoid OOM. You can set `max_memory` in to a higher value to use more memory (at your own risk).
2024-10-24 00:41:00,398 WARNING: The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function.
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00,  4.19it/s]
2024-10-24 00:41:01,580 WARNING: Some parameters are on the meta device because they were offloaded to the cpu.
Captioning images...:   0%|                                                                                                                                           | 0/57 [00:00<?, ?it/s]2024-10-24 00:41:01,902 ERROR: Generation failed: Tensor.item() cannot be called on meta tensors
Captioning images...:   2%|██▎                                                                                                                                | 1/57 [00:00<00:18,  3.11it/s]2024-10-24 00:41:01,904 ERROR: Generation failed: Tensor.item() cannot be called on meta tensors

Note that I used python batch-alpha2.py because py batch-alpha2.py gave a different error:

$ py batch-alpha2.py
/usr/bin/py:29: SyntaxWarning: invalid escape sequence '\.'
  if re.match('np(\..*)?$', raw_module_name):
/usr/bin/py:31: SyntaxWarning: invalid escape sequence '\.'
  elif re.match('pd(\..*)?$', raw_module_name):
Traceback (most recent call last):
  File "/usr/bin/py", line 167, in <module>
    result = eval(args.expression)
             ^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
    batch-alpha2.py
NameError: name 'batch' is not defined

I did install pythonpy on my non-venv main system, but that doesn't seem to help.

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

1 participant