-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Missing module '_C'? #53
Comments
same |
I meet the same problem, I solved it with running the command"python setup.py build_ext --inplace" @Pizzawookiee @XinrunXu |
This worked for me as well. Thanks! |
Do not work for me: (sam2) C:\Users\PS\Desktop\segment-anything-2>python setup.py clean --all (sam2) C:\Users\PS\Desktop\segment-anything-2>python setup.py build_ext --inplace The above exception was the direct cause of the following exception: Traceback (most recent call last):
|
Hi, we have added Regarding this error: This is usually because you haven't run the |
@XinrunXu the issue you're facing is likely due to the line
in your error log. It suggested that your local compiler doesn't match the one required for the |
I get an error with this line of code in segment-anything-2\sam2\utils\misc.py (about line 60-ish)
def get_connected_components(mask):
"""
Get the connected components (8-connectivity) of binary masks of shape (N, 1, H, W).
The code I use to call it comes from the example automatic mask generation notebook, it seems to fail due to changing the mask generator line to this:
mask_generator_2 = SAM2AutomaticMaskGenerator(
model=sam2,
points_per_side=64,
points_per_batch=128,
pred_iou_thresh=0.7,
stability_score_thresh=0.92,
stability_score_offset=0.7,
crop_n_layers=1,
box_nms_thresh=0.7,
crop_n_points_downscale_factor=2,
min_mask_region_area=25.0,
use_m2m=True,
)
The specific error is:
ImportError: cannot import name '_C' from 'sam2'
The text was updated successfully, but these errors were encountered: