Shua-Kang / ros_pytorch_yolov5

23 stars 8 forks source link

Error when "roslaunch ros_pytorch_yolov5 detector.launch device:=cpu view_img:=True" #16

Open aimanalimie opened 1 year ago

aimanalimie commented 1 year ago

May I know why this error occur?

aiman@aiman:~/catkin_ws_cv_bridge$ roslaunch ros_pytorch_yolov5 detector.launch device:=cpu view_img:=True ... logging to /home/aiman/.ros/log/13894466-7e0f-11ed-a8b6-b0fc36e80577/roslaunch-aiman-29519.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://aiman:33769/

SUMMARY

PARAMETERS

NODES / detect_manager (ros_pytorch_yolov5/detect.py)

ROS_MASTER_URI=http://localhost:11311

process[detect_manager-1]: started with pid [29537] Traceback (most recent call last): File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 14, in from skimage.transform import resize File "/home/aiman/anaconda3/lib/python3.9/site-packages/skimage/init.py", line 125, in from .util.dtype import (img_as_float32, File "/home/aiman/anaconda3/lib/python3.9/site-packages/skimage/util/init.py", line 17, in from ._map_array import map_array File "/home/aiman/anaconda3/lib/python3.9/site-packages/skimage/util/_map_array.py", line 2, in from ._remap import _map_array File "skimage/util/_remap.pyx", line 1, in init skimage.util._remap ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject [detect_manager-1] process has died [pid 29537, exit code 1, cmd /home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py __name:=detect_manager __log:=/home/aiman/.ros/log/13894466-7e0f-11ed-a8b6-b0fc36e80577/detect_manager-1.log]. log file: /home/aiman/.ros/log/13894466-7e0f-11ed-a8b6-b0fc36e80577/detect_manager-1*.log

Shua-Kang commented 1 year ago

I think it is because the version of NumPy is too old. I have tested the repo on numpy==1.19.5. I think you can try to upgrade it with pip install --upgrade numpy.

aimanalimie commented 1 year ago

@Shua-Kang sorry for late reply. I able to run it before but I'm forgot how I make it. Now, the issue occur back.

I tried topip install --upgrade numpy but it doesn't follow the requirement

Shua-Kang commented 1 year ago

Did you use

cd ros_pytorch_yolov5/yolov5/
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt

to install the python package? If not, I recommend you can try to create a new python environment with anaconda and then install packages like that.

aimanalimie commented 1 year ago

yep, I follow all the steps.

I manage to run it now. thank you