吴恩达深度学习课后作业-目标检测的环境配置
生活随笔
收集整理的這篇文章主要介紹了
吴恩达深度学习课后作业-目标检测的环境配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
吳恩達深度學習-目標檢測課后作業中使用的是tensorflow 1.X的版本,現在使用tf 2.x會出現各種報錯問題,比較簡單的方法是創建虛擬環境,然后安裝tf 1.x運行代碼
- 使用anaconda創建虛擬環境,并在jupyter notebook中運行代碼
- 安裝tensorflow和keras后,numpy和h5py這兩個包的版本過高,在運行代碼時會出現警告和錯誤,需要降級
- keras的版本過高也可能會有錯誤
tensorflow因numpy版本過高引起的警告:FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated…
h5py版本太高引起報錯: AttributeError: ‘str’ object has no attribute ‘decode’
在虛擬環境中安裝指定版本的依賴庫
# 創建并激活虛擬環境(yolov2_keras是虛擬環境名稱) conda create -n yolov2_keras activate yolov2_keras# 安裝可以運行代碼的各版本依賴庫 (使用清華源安裝) pip install tensorflow==1.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install keras==2.3 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install numpy==1.16.0 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple pip install h5py==2.10.0 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install imageio -i https://pypi.tuna.tsinghua.edu.cn/simple#將虛擬環境添加到jupypter notebook的kernel中 python -m ipykernel install --name yolov2_keras # 安裝插件使jupyter支持虛擬環境 conda install nb_conda總結
以上是生活随笔為你收集整理的吴恩达深度学习课后作业-目标检测的环境配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java微服务面试题及答案2022,微服
- 下一篇: 计算机科学与技术毕业论文题目【115个】