天天看點

tensorflow與tensorflow-cpu、tensorflow-gpu差別

1.tensorflow與tensorflow-cpu、tensorflow-gpu差別

  tensorflow是目前機器學習主流架構之一,安裝時偶爾會遇到一些問題。tensorflow目前分為tensorflow1.x與tensorflow2.x版本,差別很大,這裡不做解釋。下面是參考網上的tensorflow三個安裝包的差別。

環境

tensorflow==1.x

tensorflow-gpu==1.x

tensorflow-cpu==2.x

tensorflow==2.x

隻有CPU

cpu運作

有GPU且裝Cuda和Cudnn

gpu運作

有GPU未裝Cuda或Cudnn

2.python的第三方包國内鏡像

  下面提供python的第三方包國内鏡像

  清華:https://pypi.tuna.tsinghua.edu.cn/simple

  阿裡雲:http://mirrors.aliyun.com/pypi/simple/

  中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/

  華中理工大學:http://pypi.hustunique.com/

  山東理工大學:http://pypi.sdutlinux.org/ 

  豆瓣:http://pypi.douban.com/simple/

  note:新版ubuntu要求使用https源,要注意。

如果是pycharm可以按如圖所示添加,也可以這樣使用在指令行輸入pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple安裝包。

tensorflow與tensorflow-cpu、tensorflow-gpu差別

如果安裝了在pycharm,在pycharm中根據選擇國内的鏡像安裝即可。

tensorflow與tensorflow-cpu、tensorflow-gpu差別