Ar-Ray-code / YOLOv5-ROS

YOLOv5 + ROS2 object detection package (Does not circumvent the AGPL)
GNU General Public License v3.0
62 stars 22 forks source link

ModuleNotFoundError: No module named 'yolov5_ros.models' #6

Open 13randNEW opened 1 year ago

13randNEW commented 1 year ago

The log is shown below.

scorpion@scorpion-Alienware-15-R2:~/YOLOv5-ROS/yolov5_ros$ ros2 launch yolov5_ros yolov5s_simple.launch.py
[INFO] [launch]: All log files can be found below /home/scorpion/.ros/log/2022-12-20-17-38-03-987038-scorpion-Alienware-15-R2-9422
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [v4l2_camera_node-1]: process started with pid [9424]
[INFO] [yolov5_ros-2]: process started with pid [9426]
[v4l2_camera_node-1] [INFO] [1671575884.208218548] [v4l2_camera]: Driver: uvcvideo
[v4l2_camera_node-1] [INFO] [1671575884.208412683] [v4l2_camera]: Version: 331584
[v4l2_camera_node-1] [INFO] [1671575884.208436659] [v4l2_camera]: Device: Integrated_Webcam_HD: Integrate
[v4l2_camera_node-1] [INFO] [1671575884.208455103] [v4l2_camera]: Location: usb-0000:00:14.0-7
[v4l2_camera_node-1] [INFO] [1671575884.208471871] [v4l2_camera]: Capabilities:
[v4l2_camera_node-1] [INFO] [1671575884.208488101] [v4l2_camera]:   Read/write: NO
[v4l2_camera_node-1] [INFO] [1671575884.208504908] [v4l2_camera]:   Streaming: YES
[v4l2_camera_node-1] [INFO] [1671575884.208528334] [v4l2_camera]: Current pixel format: YUYV @ 640x480
[v4l2_camera_node-1] [INFO] [1671575884.208747031] [v4l2_camera]: Available pixel formats: 
[v4l2_camera_node-1] [INFO] [1671575884.208774567] [v4l2_camera]:   YUYV - YUYV 4:2:2
[v4l2_camera_node-1] [INFO] [1671575884.208792819] [v4l2_camera]:   MJPG - Motion-JPEG
[v4l2_camera_node-1] [INFO] [1671575884.208810979] [v4l2_camera]: Available controls: 
[v4l2_camera_node-1] [INFO] [1671575884.208834777] [v4l2_camera]:   Brightness (1) = 0
[v4l2_camera_node-1] [INFO] [1671575884.208856682] [v4l2_camera]:   Contrast (1) = 0
[v4l2_camera_node-1] [INFO] [1671575884.208877763] [v4l2_camera]:   Saturation (1) = 64
[v4l2_camera_node-1] [INFO] [1671575884.209672436] [v4l2_camera]:   Hue (1) = 0
[v4l2_camera_node-1] [INFO] [1671575884.209700335] [v4l2_camera]:   White Balance Temperature, Auto (2) = 1
[v4l2_camera_node-1] [INFO] [1671575884.209721638] [v4l2_camera]:   Gamma (1) = 100
[v4l2_camera_node-1] [INFO] [1671575884.209742055] [v4l2_camera]:   Power Line Frequency (3) = 2
[v4l2_camera_node-1] [INFO] [1671575884.210499628] [v4l2_camera]:   White Balance Temperature (1) = 4600
[v4l2_camera_node-1] [INFO] [1671575884.210524687] [v4l2_camera]:   Sharpness (1) = 2
[v4l2_camera_node-1] [INFO] [1671575884.210546682] [v4l2_camera]:   Backlight Compensation (1) = 3
[v4l2_camera_node-1] [INFO] [1671575884.210566907] [v4l2_camera]:   Exposure, Auto (3) = 3
[v4l2_camera_node-1] [INFO] [1671575884.211420513] [v4l2_camera]:   Exposure (Absolute) (1) = 156
[v4l2_camera_node-1] [INFO] [1671575884.211445963] [v4l2_camera]:   Exposure, Auto Priority (2) = 1
[v4l2_camera_node-1] [INFO] [1671575884.211464194] [v4l2_camera]: Time-per-frame support: YES
[v4l2_camera_node-1] [INFO] [1671575884.211481798] [v4l2_camera]:   Current time per frame: 1/30 s
[v4l2_camera_node-1] [INFO] [1671575884.211498995] [v4l2_camera]:   Available intervals:
[v4l2_camera_node-1] [INFO] [1671575884.211537585] [v4l2_camera]:     MJPG 848x480: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211563511] [v4l2_camera]:     MJPG 960x540: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211589060] [v4l2_camera]:     MJPG 1280x720: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211608484] [v4l2_camera]:     MJPG 1920x1080: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211628875] [v4l2_camera]:     YUYV 160x120: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211648906] [v4l2_camera]:     YUYV 320x180: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211667603] [v4l2_camera]:     YUYV 320x240: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211686215] [v4l2_camera]:     YUYV 424x240: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211705252] [v4l2_camera]:     YUYV 640x360: 1/30
[v4l2_camera_node-1] [INFO] [1671575884.211724573] [v4l2_camera]:     YUYV 640x480: 1/30 1/30
[v4l2_camera_node-1] [ERROR] [1671575884.235226969] [v4l2_camera]: Failed setting value for control White Balance Temperature to 4600: Input/output error (5)
[v4l2_camera_node-1] [ERROR] [1671575884.240629678] [v4l2_camera]: Failed setting value for control Exposure (Absolute) to 156: Input/output error (5)
[v4l2_camera_node-1] [INFO] [1671575884.241630530] [v4l2_camera]: Starting camera
[v4l2_camera_node-1] [INFO] [1671575884.502911951] [v4l2_camera]: using default calibration URL
[v4l2_camera_node-1] [INFO] [1671575884.502987893] [v4l2_camera]: camera calibration URL: file:///home/scorpion/.ros/camera_info/integrated_webcam_hd:_integrate.yaml
[v4l2_camera_node-1] [ERROR] [1671575884.503063327] [camera_calibration_parsers]: Unable to open camera calibration file [/home/scorpion/.ros/camera_info/integrated_webcam_hd:_integrate.yaml]
[v4l2_camera_node-1] [WARN] [1671575884.503075037] [v4l2_camera]: Camera calibration file /home/scorpion/.ros/camera_info/integrated_webcam_hd:_integrate.yaml not found
[yolov5_ros-2] Traceback (most recent call last):
[yolov5_ros-2]   File "/home/scorpion/YOLOv5-ROS/yolov5_ros/install/yolov5_ros/lib/yolov5_ros/yolov5_ros", line 33, in <module>
[yolov5_ros-2]     sys.exit(load_entry_point('yolov5-ros==0.2.0', 'console_scripts', 'yolov5_ros')())
[yolov5_ros-2]   File "/home/scorpion/YOLOv5-ROS/yolov5_ros/install/yolov5_ros/lib/yolov5_ros/yolov5_ros", line 25, in importlib_load_entry_point
[yolov5_ros-2]     return next(matches).load()
[yolov5_ros-2]   File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
[yolov5_ros-2]     module = import_module(match.group('module'))
[yolov5_ros-2]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[yolov5_ros-2]     return _bootstrap._gcd_import(name[level:], package, level)
[yolov5_ros-2]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[yolov5_ros-2]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[yolov5_ros-2]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[yolov5_ros-2]   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
[yolov5_ros-2]   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
[yolov5_ros-2]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[yolov5_ros-2]   File "/home/scorpion/YOLOv5-ROS/yolov5_ros/install/yolov5_ros/lib/python3.8/site-packages/yolov5_ros/main.py", line 12, in <module>
[yolov5_ros-2]     from yolov5_ros.models.common import DetectMultiBackend
[yolov5_ros-2] ModuleNotFoundError: No module named 'yolov5_ros.models'
[ERROR] [yolov5_ros-2]: process has died [pid 9426, exit code 1, cmd '/home/scorpion/YOLOv5-ROS/yolov5_ros/install/yolov5_ros/lib/yolov5_ros/yolov5_ros --ros-args --params-file /tmp/launch_params_jd_gmg18'].

I only changed script_dir and install_scripts from - to underscore. Could you help me?

yquemener commented 1 year ago

I fixed it by modifying setup.py https://github.com/yquemener/YOLOv5-ROS/blob/patch-3/yolov5_ros/setup.py