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

Numpy version issue #25

Open
samholtzen opened this issue Sep 25, 2024 · 1 comment
Open

Numpy version issue #25

samholtzen opened this issue Sep 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@samholtzen
Copy link

Tried using cellSAM by running the following:

from cellSAM import segment_cellular_image, get_model
import numpy as np
import torch
from scipy.ndimage import binary_dilation
import matplotlib.pyplot as plt
import matplotlib.patches as patches
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

img = image[0,...,2]
print(img.dtype)
mask, embedding, bounding_boxes = segment_cellular_image(np.array(img), device=str(device))

plt.imshow(mask)

with the most recent version of Numpy and it gave me the error:

TypeError: expected np.ndarray (got numpy.ndarray)

When I rolled back the version to numpy==1.23.5, I was able to run the code block.

@rossbar rossbar added the bug Something isn't working label Feb 15, 2025
@rossbar
Copy link
Contributor

rossbar commented Feb 15, 2025

Thanks @samholtzen - this too is a consequence of the torchvision pin, which also then requires numpy<2. This will be solved by #17 - thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants