1、官网及帮助文档 

官网: https://www.tensorflow.org/install/install_windows

 中文帮助文档:https://efeiefei.gitbooks.io/tensorflow_documents_zh/install/install_windows.html

a) cpu版本安装:pip3 install --upgrade tensorflow 

上面试默认安装最新版本的tensorflow,如果想安装指定版本的tensorflow,如1.4.0,命令:pip3 install tensorflow==1.4.0 

b)gpu版本安装:pip3 install --upgrade tensorflow-gpu,需要先安装cuda,cudnn,需要注意版本

备注:目前tensorflow在windows只支持python3.5.x及以上版本,需要使用pip3安装tensorflow。

2、cpu版本安装可能遇到的问题

2.1、ImportError: Could not find 'msvcp140.dll'. TensorFlow requires that this DLL... ,解决方案:安装微软为VS2015提供的组件Visual C++ Redistributable for Visual Studio 2015,网址https://www.microsoft.com/zh-CN/download/details.aspx?id=48145,下载后直接安装就好了。

2.2、Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2,应该是编译问题,解决方案:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'  #忽略警告

3、简单命令

a)查看tensorflow版本及安装路径

import tensorflow as tf
tf.
__version__ #版本
tf.__path__ #路径

 

4、TensorFlow for Java安装

https://vimsky.com/article/3623.html

 

5、第一个tensorflow示例程序

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello,TensorFlow!

在tensorflow官网Develop栏中有TensorFlow 使用入门示例程序,根据文档说明利用git把示例程序down下来,然后安装说明运行即可。另外也可以把"models/samples/core/get_started/"中的四个python文件拷贝到pyCharm工程运行。

TensorBoard:可视化学习

 

 

6、教程

精通Tensorflow 1.x: https://www.kancloud.cn/wizardforcel/mastering-tf-1x-zh/1278657

tf.keras.layers.GRUCell:https://runebook.dev/zh-CN/docs/tensorflow/keras/layers/grucell

使用TensorFlow实现LSTM和GRU网络:https://www.cnblogs.com/zyly/p/9029591.html#_label3_3

 

相关文章:

  • 2021-08-31
  • 2021-09-15
  • 2022-02-08
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-05-16
猜你喜欢
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-12-23
  • 2022-12-23
  • 2021-08-14
相关资源
相似解决方案