[FishBotCamera]3.结合YOLO实现检测
-
大佬,执行以上步骤的时候出现下图问题怎么办?
-
@2652794104 把右边终端的所有日志复制粘贴出来看看
-
-
@2652794104 感觉你电脑yolo没安装好
-
@小鱼 但卸载后重新安装了还是不行,我在Ubuntu终端的情况如下VirtualBox:~/fishbot_ws/src$ cd ~/fishbot_ws/ colcon build source install/setup.bash Starting >>> fishbot_camera Starting >>> yolov5_ros2 /home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) /home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) [0.584s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'yolov5_ros2' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future) --- stderr: yolov5_ros2 /home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) Traceback (most recent call last): File "/home/huan/fishbot_ws/src/yolov5_ros2/setup.py", line 7, in <module> setup( File "/home/huan/.local/lib/python3.10/site-packages/setuptools/init.py", line 117, in setup return distutils.core.setup(**attrs) File "/home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) File "/home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands self.run_command(cmd) File "/home/huan/.local/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/huan/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/huan/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 312, in run self.find_sources() File "/home/huan/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 320, in find_sources mm.run
-
在执行colcon build的这一步时候出现以下报错该如何处理
-
@2652794104 是不是 setup 的版本有问题
-
@2652794104 编译其他功能包会这样子吗
-
@小鱼 编译其他功能包好像没出现类似的
-
@2652794104 日志看起来很奇怪,换台电脑试试可以不可以编译
-
-
@小鱼 谢谢大佬,解决了
-
小鱼,这个用CPU会有点卡,可以用GPU吗,启动时代码改成gpu好像显示只能用cpu或者跳过
-
@2431039560 这个要看yolo那边的了
-
ImportError: cannot import name 'Detect' from 'models.yolo' (/home/jkr/.local/lib/python3.10/site-packages/ultralytics/models/yolo/init.py)
[ros2run]: Process exited with failure 1
ros2 run yolov5_ros2 yolo_detect_2d --ros-args -p device:=cpu -p image_topic:=/fishbot_camera_raw
在输入这段代码后会显示这个错误 -
此回复已被删除! -
@jkr yolo安装问题吧,重装试试
-
@小鱼 重装了一边不太行
-
@小鱼 (1) In PyTorch 2.6, we changed the default value of the
weights_only
argument intorch.load
fromFalse
toTrue
. Re-runningtorch.load
withweights_only
set toFalse
will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load withweights_only=True
please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL numpy.core.multiarray._reconstruct was not an allowed global by default. Please usetorch.serialization.add_safe_globals([numpy.core.multiarray._reconstruct])
or thetorch.serialization.safe_globals([numpy.core.multiarray._reconstruct])
context manager to allowlist this global if you trust this class/function.
重运行完报这个错