从TF.TENSOR模型提取编号
我正在使用softmax
从基于CNN-MFCC的模型中获取概率向量。我已经开始使用命令,
model(prediction_feature)
而不是
model.predict(prediction_feature)
在通过循环传递model.predict
命令时,我一直在获取警告消息。但是,现在,当我记录概率时,值将以表单返回:
tf.Tensor(0.00087791355, shape=(), dtype=float32)
而仅对于使用model.predict.predict
命令时的数字0.00087791355。
有没有一种方法可以从模型(Prediction_Feature)
方法中提取数字?
I am using softmax
to get the probability vector from a CNN-MFCC based model. I've started to use the command
model(prediction_feature)
instead of
model.predict(prediction_feature)
as I kept getting warning messages while passing the model.predict
command over a loop. However, now when I record the probability, the value gets returned in the form:
tf.Tensor(0.00087791355, shape=(), dtype=float32)
instead for just the number 0.00087791355 when I use the model.predict
command.
Is there a way to extract just the number from the model(prediction_feature)
approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
numpy
使用numpy.Array(tensor)
或tensor.numpy()
method进行张量。例如:
,但是,请让我们知道使用
model.predict(prediction_feature)
时收到的警告消息。You can convert a tensor to a
NumPy
array either usingnumpy.array(tensor)
or thetensor.numpy()
method.For example:
However, please let us know the warning messages you get while using
model.predict(prediction_feature)
.