首页 > 解决方案 > model.predict.print() 未在 tensorflow.js 中显示所有结果

问题描述

加载模型后,预测结果如下:

Tensor
    [[0.5050125, 0.6573772],
     [0.5050992, 0.6576715],
     [0.5049844, 0.6572819],
     ...,
     [0.5045587, 0.6558315],
     [0.5050324, 0.6574449],
     [0.5043802, 0.6552206]]

如何让它显示所有结果而不是“...”?

标签: node.jstensorflowpredictiontensortensorflow.js

解决方案


这边走:

import tensorflow as tf

#Let's create a simulated data...
Tensor=tf.random.normal([10,2])

#...and print every row on screen:
for i in range(len(Tensor)):
    print(Tensor[i].numpy())

推荐阅读