我希望在张量板中有一个混淆矩阵的视觉效果.为此,我正在修改Tensorflow Slim的评估示例:https://github.com/tensorflow/models/blob/master/slim/eval_image_classifier.py
在此示例代码中,Accuracy已经提供但是不可能直接添加"confusion matrix"度量标准,因为它不是流式传输.
流媒体指标和非流媒体指标有什么区别?
因此,我试图像这样添加它:
c_matrix = slim.metrics.confusion_matrix(predictions, labels)
#These operations needed for image summary
c_matrix = tf.cast(c_matrix, uint8)
c_matrix = tf.expand_dims(c_matrix, 2)
c_matrix = tf.expand_dims(c_matrix, 0)
op = tf.image_summary("confusion matrix", c_matrix, collections=[])
tf.add_to_collection(tf.GraphKeys.SUMMARIES, op)
Run Code Online (Sandbox Code Playgroud)
这会在tensorboard中创建一个图像,但可能存在格式问题.矩阵应在0-1之间归一化,以便产生有意义的图像.
我怎样才能产生有意义的混淆矩阵?我该如何处理多批评估过程?
我正在使用gogo与beego框架,我有服务字符串作为json的问题.
EventsByTimeRange以json格式返回字符串值
this.Data["json"] = dao.EventsByTimeRange(request) // this -> beego controller
this.ServeJson()
"{\"key1\":0,\"key2\":0}"
Run Code Online (Sandbox Code Playgroud)
我怎样才能摆脱引号?
我正在研究 beego 应用程序。我试图在两台不同的机器上运行相同的代码。两者都是ubuntu。在一台机器上,它运行没有任何问题,但在另一台机器上我得到了以下错误日志。我对两者都有相同的文件组织,您认为为什么会发生这种情况?
controllers/EventController.go:18: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/EventController.go:24: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/EventController.go:30: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/default.go:14: c.TplNames undefined (type *MainController has no field or method TplNames)
Run Code Online (Sandbox Code Playgroud)
偶控制器:
package controllers
import (
"github.com/astaxie/beego"
"solardatabase/models"
"solardatabase/dao"
"solardatabase/services"
)
type EventController struct {
beego.Controller
}
func (this *EventController) ListEvents() {
res := struct{ Tasks []*models.Event }{dao.GetAllEvents()}
this.Data["json"] = res
this.ServeJson()
}
func …
Run Code Online (Sandbox Code Playgroud)