snowkylin / tensorflow-cn Goto Github PK
View Code? Open in Web Editor NEW简单粗暴 TensorFlow (1.X) | A Concise Handbook of TensorFlow (1.X) | 此版本不再更新,新版见 https://tf.wiki
Home Page: https://v1.tf.wiki
简单粗暴 TensorFlow (1.X) | A Concise Handbook of TensorFlow (1.X) | 此版本不再更新,新版见 https://tf.wiki
Home Page: https://v1.tf.wiki
教育优惠申请指南,因为申请指南不是很容易在 jetbrains页面找到,所以贴在这里,希望补上链接,以期减少盗版的传播.
To fix issue: 'module' object has no attribute 'enable_eager_execution'
Simply change tf.enable_eager_execution() to tf.contrib.eager.enable_eager_execution()
程序运行时显存占用持续增长
TensorFlow模型>基础示例:多层感知机(MLP)的一处代码
class MLP(tf.keras.Model):
def __init__(self):
super().__init__()
self.dense1 = tf.keras.layers.Dense(units=100, activation=tf.nn.relu)
self.dense2 = tf.keras.layers.Dense(units=10)
def call(self, inputs):
x = self.dense1(inputs)
x = self.dense2(x)
return x
def predict(self, inputs):
logits = self(inputs) # 这一行要怎么理解?
return tf.argmax(logits, axis=-1)
倒数第二行代码, 是不是等价于self.call(inputs)
?
现文档版本(0.3)的“TensorFlow 安装”一章对于 GPU 版本的 TF 安装叙述略过简短,而它相比 TensorFlow 的 CPU 版本安装更加复杂.在“安装前的环境配置”一节中,建议将 CPU 与 GPU 版的安装分开叙述.在此我愿抛砖引玉.我使用的是 Windows 10 x64 平台,GPU 版本的 TF 安装步骤如下:
---------- 以下正文开始 ----------
GPU 版本 TensorFlow 由 tensorflow-gpu 包支持(该包也支持 CPU,因此无须再安装仅 CPU 版的 TensorFlow),以下是其安装步骤:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
.C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64
pip3 install tensorflow-gpu
pip3 install tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl
可用 Python 执行以下命令来测试安装结果:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
如果打印结果中包含 GPU 设备,则说明 GPU 版的 TensorFlow 已正确地识别了你电脑的 Nvidia 显卡.
---------- 正文结束 ----------
由于我并没有使用 Anaconda,因此安装步骤与文中将有所出入.
In the MLP example, this line
mnist = tf.contrib.learn.datasets.load_dataset("mnist")
prints tons of deprecation error:
WARNING:tensorflow:From /home/zhanghuimeng/Documents/learnTensorFlow/simple_introduction/multilayer_perceptron.py:9: load_dataset (from tensorflow.contrib.learn.python.learn.datasets) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data.
...
And it actually can't download anything. (The reason might be...) In the end, you might have to download MNIST by hand. (see this)
A better (not deprecated) alternative is:
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
But it cannot download anything either. Finally I had to download from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz and load it by NumPy.
There might be a better alternative, but I still suggest using something not deprecated.
静态图模式可以通过tf.summary.FileWriter将模型结构保存下来,并在tensorboard上显示,在eager模式下怎么弄?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.