Jungsu-Yun / yolov5_deepsort_ros

Wrapped yolov5-deepport to ROS
MIT License
35 stars 15 forks source link

no yolov5_in_syspath in yolov5.utils.general #1

Open wuyuwangqingtian opened 2 years ago

wuyuwangqingtian commented 2 years ago

Hello, I made an error while running your code。 ImportError: cannot import name 'yolov5_in_syspath'

Hopesun-ice commented 1 year ago

i meet the same questions, and how to solve this ?

yangkuo12 commented 1 year ago

me too, i also meet the same question and can not solve this problem so far

swy767 commented 1 year ago

I think this issue is due to differences in the code of different versions of yolov5. You can solve this problem by adding a little code in yolov5.utils.general.

def yolov5_in_syspath():
    yolov5_folder_dir = str(Path(__file__).parents[1].absolute())
    try:
        sys.path.insert(0, yolov5_folder_dir)
        yield
    finally:
        sys.path.remove(yolov5_folder_dir)

imshow_ = cv2.imshow  # copy to avoid recursion errors