python opencv和tensorflow缺少各種模塊解決

opencv

Module ‘cv2’ has no ‘imread’ member
Module ‘cv2’ has no ‘imwrite’ member

import cv2

改成

from cv2 import cv2

tensorflow

Module ‘tensorflow’ has no ‘gfile’ member
Module ‘tensorflow’ has no ‘Session’ member
Module ‘tensorflow’ has no ‘GraphDef’ member
等等等等
因爲我裝的tensorflow是2.x 原本用的是1.x解決方法就是降級tensorflow

pip uninstall tensorflow
pip --default-timeout=1000 install -U tensorflow==1.15.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章