keras-yolov3

1.github:https://github.com/qqwweee/keras-yolo3

  中文使用教程:https://busy.org/@hongtao/yolo

2. keras中文:https://keras.io/zh/getting-started/sequential-model-guide/

3.通过anonconda3安装keras,tensoflow-gpu环境:https://blog.csdn.net/qq_38901147/article/details/90049666

 

 

报错:
1.运行python yolo_video.py --input

 File "/home/zengjun/Resume/yolo_detection/keras_yolov3/keras-yolo3/yolo.py", line 173, in detect_video
    import cv2
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type

原因:https://blog.csdn.net/Changer_sun/article/details/81079756这篇文章讲解了问题背景

>>> import sys
>>> sys.path
['', '/usr/lib/python3.5/site-packages', '/home/zengjun/tutorial_ws/devel/lib/python2.7/dist-packages', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/home/zengjun/anaconda3/envs/tensoflow35/lib/python35.zip', '/home/zengjun/anaconda3/envs/tensoflow35/lib/python3.5', '/home/zengjun/anaconda3/envs/tensoflow35/lib/python3.5/plat-linux', '/home/zengjun/anaconda3/envs/tensoflow35/lib/python3.5/lib-dynload', '/home/zengjun/.local/lib/python3.5/site-packages', '/home/zengjun/anaconda3/envs/tensoflow35/lib/python3.5/site-packages']
>>> 
环境变量'/opt/ros/kinetic/lib/python2.7/dist-packages'的优先级更高,将其从环境变量删除就不会报错
def detect_video(yolo, video_path, output_path=""):
    import sys
    sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')  #Zen add this
    import cv2

 

你可能感兴趣的:(tersorflow,python)