简体   繁体   English

如何使用 Tensorboard 检查训练模型的准确性?

[英]How do I check accuracy of my training model using Tensorboard?

I'm running a CNN for image classification.我正在运行用于图像分类的 CNN。 Every 100 steps, a file is created in a folder either as: model.ckpt-0.data-00000-of-00001, model.ckpt-0.index, model.ckpt-0.meta.每 100 步,就会在文件夹中创建一个文件:model.ckpt-0.data-00000-of-00001、model.ckpt-0.index、model.ckpt-0.meta。 There are also these files: graph.pbtxt and checkpoint.还有这些文件:graph.pbtxt 和 checkpoint。

Which of these files would I use to view the accuracy of my training model in Tensorboard?我将使用这些文件中的哪个文件来查看 Tensorboard 中训练模型的准确性?

None of these contain the accuracy values, they are the definition of the model (graph.pbtxt) and the model weights (checkpoint / ckpt files).这些都不包含准确度值,它们是模型的定义(graph.pbtxt)和模型权重(checkpoint / ckpt 文件)。

By default the fit method will output any losses or metrics (eg accuracy) you defined when you called compile on the model, eg默认情况下, fit方法将输出您在模型上调用compile时定义的任何损失或指标(例如准确性),例如

model.compile(optimizer="Adam", loss="mse", metrics=["mae", "acc"])

will compile the model with the mse loss and the mae and acc metrics.将使用mse损失以及maeacc指标编译模型。 The values will be printed at the end of each epoch, or more often if you change the verbose argument when calling fit这些值将在每个时代结束时打印,或者如果您在调用fit时更改verbose参数,则会更频繁地打印

Perhaps the best way to visualise these values is to use Tensorboard .也许可视化这些值的最佳方法是使用Tensorboard To do this you create a tensorboard callback (a callback is a class with methods that are called at the start / end of training, epoch and batch) which will write the metrics and other info into the training directory.为此,您需要创建一个 tensorboard 回调(回调是一个具有在训练开始/结束时调用的方法、时期和批处理的类),它将指标和其他信息写入训练目录。

Then you may run tensorboard from inside the training directory, eg tensorboard --logdir=/path/to/training/dir to get a nice web-based UI in which to monitor training.然后你可以从训练目录中运行 tensorboard,例如tensorboard --logdir=/path/to/training/dir以获得一个很好的基于 web 的 UI 来监控训练。

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

相关问题 使用Keras,当我将Tensorboard回调添加到我的神经网络时,准确性降低了。 我该如何解决? - Using Keras, when I add a Tensorboard callback to my neural network, the accuracy decreases. How do I fix this? 当训练具有高精度但 model.evaluate() 精度低时,如何改进 model? - How do I improve the model when training has high accuracy but model.evaluate() gives low accuracy? 如何使用 Detectron2 的 tensorboard 获得测试精度? - How can I get testing accuracy using tensorboard for Detectron2? 如何在 cnn 训练 model 中获得最终准确度结果? - How i can get the final accuracy result in cnn training model? 如何打印 SVM 模型的准确性和验证准确性? - How can do I print accuracy and validation accuracy for my SVM model? 如何提前停止在Keras进行模型训练? - How do I early stop my model training in Keras? 如何保存我的 model 在训练期间创建的嵌入? - How do I save the embeddings my model creates during training? 带有自定义训练循环的 Tensorboard Graph 不包括我的 Model - Tensorboard Graph with custom training loop does not include my Model 如何在循环中检查准确性? - How do I check accuracy within the loop? 如何在训练后获得 model 的最高精度 - How to get the highest accuracy of a model after the training
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM