天天看点

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区别