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

While running grounded_sam2_local_demo.py facing following warning #30

Open
Jaykumaran opened this issue Aug 23, 2024 · 2 comments
Open

Comments

@Jaykumaran
Copy link

`UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3609.)
final text_encoder_type: bert-base-uncased

UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)

UserWarning: torch.utils.checkpoint: the use_reentrant parameter should be passed explicitly. In version 2.4 we will raise an exception if use_reentrant is not passed. use_reentrant=False is recommended, but if you need to preserve the current default behavior, you can pass use_reentrant=True. Refer to docs for more details on the differences between the two variants.

UserWarning: None of the inputs have requires_grad=True. Gradients will be None
(sam2) opencvuniv@opencvuniv:~/.../Grounded-SAM2/Grounded-SAM-2$ python grounded_sam2_local_demo.py --user_reentrant=False
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3609.)
final text_encoder_type: bert-base-uncased

UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)

UserWarning: torch.utils.checkpoint: the use_reentrant parameter should be passed explicitly. In version 2.4 we will raise an exception if use_reentrant is not passed. use_reentrant=False is recommended, but if you need to preserve the current default behavior, you can pass use_reentrant=True. Refer to docs for more details on the differences between the two variants.

UserWarning: None of the inputs have requires_grad=True. Gradients will be None
`

@rentainhe
Copy link
Collaborator

Hi @Jaykumaran Would you like to share more info about your error, UserWarning is not bug I think

@siberianspot
Copy link

siberianspot commented Aug 23, 2024

It’s a bug in groundingdino.utils.inference.load_image() function. To fix it, append to PIL.Image open part a copy() method call, something like this:

# image_source = Image.open(image_path).convert("RGB")
image_source = Image.open(image_path).copy().convert("RGB")

@Jaykumaran Jaykumaran changed the title While running grounded_sam2_local_demo.py facing following error While running grounded_sam2_local_demo.py facing following warning Sep 1, 2024
rentainhe pushed a commit that referenced this issue Dec 21, 2024
Fix typo in comment: "evalaution" to "evaluation"
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