I ran into the same issue when trying to use pytorch after installing it via pip.
You could try compiling pytorch āmanuallyā with the latest version of cuda.
However, I downgraded to cuda 11.7 and seems to get passed that error, just to hit another:
Traceback (most recent call last):
File "C:\Users\joini\mask\zed-pytorch-master\zed_object_detection.py", line 6, in <module>
from predictor import COCODemo
File "C:\Users\joini\mask\zed-pytorch-master\predictor.py", line 6, in <module>
from maskrcnn_benchmark.modeling.detector import build_detection_model
ModuleNotFoundError: No module named 'maskrcnn_benchmark'
And when I try adding the following line of code to the predictor.py:
sys.path.append("maskrcnn_benchmark/")
I get the following error:
ImportError: cannot import name '_C' from 'maskrcnn_benchmark'
No, Iām trying to get a pre-trained model ingested into the custom detector in Unity to detect water bottles, etc. for a mixed reality ocean robotic cleanup project. Donāt need to train them myself as most are trained on bottles e.g. yolo. But I need segmentation masks as well, which yolo doesnāt support.
Any pointers?
Is there some way to use the yolo custom detector examples and obtain masks of the bottles somehow using the ZED SDK?
Edit: I see YOLO v8 supports instance seg. so is this the route I should explore?
Iām not a Yolo expert, canāt really tell. However you donāt need Pytorch to run our Custom Object detector tutorial.
It seems you also have an issue with your python wrapper (the import error you have). Can you install it again with get_python_api.py ? Are you using conda ?
Thanks for your help thus far; I got it installed. However, when trying to run the detector using:
python detector.py --weights yolov8m.pt
it throws the following error:
Traceback (most recent call last):
File "C:\Program Files (x86)\ZED SDK\samples\object detection\custom detector\python\pytorch_yolov8\detector.py", line 9, in <module>
import pyzed.sl as sl
ImportError: DLL load failed while importing sl: The specified procedure could not be found.
Nope, throws the same error outside of conda.
I installed using the wrapper. When I try to build from source I get lots of cyphon compile errorsātoo many to paste here, but this is the end of them:
------------------------------------------------------------
pyzed\sl.pyx:10455:89: 'c_REFERENCE_FRAME' is not a type identifier
Error compiling Cython file:
------------------------------------------------------------
...
# Get the Fused Position of the camera system
# \param camera_pose will contain the camera pose in world position (world position is given by the calibration of the cameras system)
# \param reference_frame defines the reference from which you want the pose to be expressed. Default : \ref REFERENCE_FRAME "REFERENCE_FRAME::WORLD".
# \return POSITIONAL_TRACKING_STATE is the current state of the tracking process
def get_position(self, camera_pose : Pose, reference_frame : REFERENCE_FRAME = REFERENCE_FRAME.WORLD, uuid: CameraIdentifier = CameraIdentifier(), position_type : POSITION_TYPE = POSITION_TYPE.FUSION):
return POSITIONAL_TRACKING_STATE(<int>self.fusion.getPosition(camera_pose.pose, <c_REFERENCE_FRAME>(<int>reference_frame.value), uuid.cameraIdentifier, <c_POSITION_TYPE>(<int>position_type.value)))
^
------------------------------------------------------------
pyzed\sl.pyx:10455:161: 'c_POSITION_TYPE' is not a type identifier
Traceback (most recent call last):
File "C:\Users\xxx\xxx\Documents\code\xxx\ZED\zed-python-api-master\src\setup.py", line 194, in <module>
extList = cythonize(extension, compiler_directives=cython_directives)
File "C:\Users\joini\AppData\Local\Programs\Python\Python310\lib\site-packages\Cython\Build\Dependencies.py", line 1134, in cythonize
cythonize_one(*args)
File "C:\Users\joini\AppData\Local\Programs\Python\Python310\lib\site-packages\Cython\Build\Dependencies.py", line 1301, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pyzed/sl.pyx
It attempts to run Ultralytics now, which is good news, but now throws a new error:
ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (C:\Users\joini\anaconda3\envs\zedyolo\lib\site-packages\matplotlib\__init__.py)
For some reason there was a series of modules (matplotlib, opencv, pillow) that needed to be uninstalled and re-installed.
Things are looking good thanks! When I run:
python detector.py --weights yolov8m.pt
The following happens in the terminal:
Intializing Network...
Initializing Camera...
Downloading https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt to 'yolov8m.pt'...
Initialized Camera
and the ZED object detection window opens. However, the window is a black screen and eventually becomes unresponsive.