简体   繁体   English

Tensorflow 2.0-Keras培训

[英]Tensorflow 2.0 - keras training

Sorry for the beginner question as I've just started to pick up Tensorflow ; 对不起,对于初学者的问题,因为我刚刚开始Tensorflow Their 2.0 version seems to be a leap in development. 他们的2.0版本似乎是发展的飞跃。

I've followed the tutorial from this site , which returns the following result: 我已经按照本站点上的教程进行操作, 该站点返回以下结果: 在此处输入图片说明

which is quite different from the site: 与网站有很大不同: 在此处输入图片说明

Here is the gist . 这是要点

I practically copied and pasted the code from the site, but somehow the result is still so different. 我实际上是从站点复制并粘贴了代码,但是在某种程度上,结果仍然如此。

The way I read my graph, there is practically no learning at all. 我阅读图表的方式实际上几乎没有学习。

  1. What causes this kind of scenario? 是什么原因导致这种情况?

  2. How do people normally tackle this kind of scenario? 人们通常如何应对这种情况?

That is because you make a mistake in this line: 那是因为您在此行中犯了一个错误:

steps_per_epoch = round(BATCH_SIZE) // BATCH_SIZE

It should be: 它应该是:

steps_per_epoch = num_train//BATCH_SIZE   # There is no need to use the round() function.

This is the original code . 这是原始代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Keras 在 Tensorflow 2.0 中无需训练即可保存模型 - Save model without training in Tensorflow 2.0 with Keras Tensorflow 2.0 Keras 的训练速度比 2.0 Estimator 慢 4 倍 - Tensorflow 2.0 Keras is training 4x slower than 2.0 Estimator Tensorflow 2.0 如何从 Keras 模型导出预测和训练模式 - Tensorflow 2.0 how to export predictions and training-mode from Keras model 验证数据可以是 tensorflow.keras 2.0 中的生成器(而训练数据是数组)吗? - Could validation data be a generator (while training data is Array) in tensorflow.keras 2.0? 使用 TPU 在 GCP 上进行 Keras/Tensorflow 培训 - Keras/Tensorflow training on GCP with TPU Keras + TensorFlow 实时训练图 - Keras + TensorFlow Realtime training chart 在 RGBA PNG 上训练 Tensorflow 2.0? - Training Tensorflow 2.0 on RGBA PNGs? 使用 Keras Tensorflow 2.0 获取梯度 - Get Gradients with Keras Tensorflow 2.0 Tensorflow 2.0:从 tensorflow keras 导入 - Tensorflow 2.0: Import from tensorflow keras 在 tensorflow2.0 中,如果我使用 tf.keras.models.Model。 我可以通过模型训练批次的数量来评估和保存模型吗? - In tensorflow2.0, if I use tf.keras.models.Model. Can I evaluate and save the model by the number of model training batches?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM