Closed hcdiekmann closed 1 year ago
Hi @hcdiekmann, which version of ultralytics are you using?
The last version, 8.0.58
, should work.
Yes indeed, I had an old version of ultralytics installed. Updating to the latest version resolves the initial error. However now I am getting the following RunTime error:
[yolov8_node-1] Traceback (most recent call last):
[yolov8_node-1] File "/home/hcdiekmann/ros2_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node", line 33, in <module>
[yolov8_node-1] sys.exit(load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'yolov8_node')())
[yolov8_node-1] File "/home/hcdiekmann/ros2_ws/install/yolov8_ros/lib/python3.10/site-packages/yolov8_ros/yolov8_node.py", line 181, in main
[yolov8_node-1] node = Yolov8Node()
[yolov8_node-1] File "/home/hcdiekmann/ros2_ws/install/yolov8_ros/lib/python3.10/site-packages/yolov8_ros/yolov8_node.py", line 55, in __init__
[yolov8_node-1] self.yolo.to(device)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/ultralytics/yolo/engine/model.py", line 344, in to
[yolov8_node-1] self.model.to(device)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1145, in to
[yolov8_node-1] return self._apply(convert)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 146, in _apply
[yolov8_node-1] self = super()._apply(fn)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply
[yolov8_node-1] module._apply(fn)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply
[yolov8_node-1] module._apply(fn)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply
[yolov8_node-1] module._apply(fn)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 820, in _apply
[yolov8_node-1] param_applied = fn(param)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1143, in convert
[yolov8_node-1] return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
[yolov8_node-1] File "/home/hcdiekmann/.local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 247, in _lazy_init
[yolov8_node-1] torch._C._cuda_init()
[yolov8_node-1] RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
[ERROR] [yolov8_node-1]: process has died [pid 637, exit code 1, cmd '/home/hcdiekmann/ros2_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node --ros-args -r __node:=yolov8_node -r __ns:=/yolo --params-file /tmp/launch_params_kilod8m_ -r image_raw:=/camera/rgb/image_raw'].
As far as I remember ultralytics should be able to run on CPU only?
Launching with ros2 launch yolov8_bringup yolov8.launch.py device:=cpu
should use CPU instead of GPU.
Thank you. This works.
Launching with
gives me an import error:
Any help would be appreciated.