question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to print or save the tensor value?

See original GitHub issue

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

1.3.1

Browser version

chrome 75.0.3770.100

Describe the problem or feature request

I need to print or save the tensor value which is a large one, I used tensor.print() but returned some data are wrapped as below. Is there a method I can get the complete data? thanks.

[[[0.0053029, 0.0025345, 0.0019749, 0.0018056, 0.0018964, 0.0074909, 0.0057911, 0.008592 , 0.0165844, 0.0111931, 0.0142552, 0.018802 , 0.0389155, 0.0074931, 0.0089398, 0.0080874, 0.0132551], [0.0286518, 0.0150542, 0.0133062, 0.0114104, 0.0111058, 0.0568453, 0.0904091, 0.1005098, 0.1731976, 0.0367494, 0.0712746, 0.2302813, 0.3100693, 0.0407135, 0.0660731, 0.0158273, 0.0259351], [0.1439301, 0.0712762, 0.0873525, 0.0327946, 0.0932145, 0.3007573, 0.5060523, 0.2420783, 0.4849318, 0.0842475, 0.155078 , 0.2600798, 0.3150103, 0.0543618, 0.0712372, 0.0157708, 0.0188604], …, [0.8499549, 0.7728117, 0.7257269, 0.1711734, 0.4685968, 0.1162975, 0.1911756, 0.0302178, 0.025949 , 0.0421997, 0.0215278, 0.0057457, 0.0026971, 0.0024616, 0.001875 , 0.0018634, 0.0017299],

Code to reproduce the bug / link to feature request

If you would like to get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

GitHub issues for this repository are tracked in the tfjs union repository.

Please file your issue there, following the guidance in that issue template.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rthadurcommented, Mar 15, 2020

Please use console.log(tensor.dataSync()) , refer

0reactions
rthadurcommented, Mar 16, 2020

@willfu thank you , closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.print | TensorFlow v2.11.0
A TensorFlow operator that prints the specified inputs to a desired output stream or logging level. The inputs may be dense or sparse...
Read more >
Print The Value Of A Tensor Object In TensorFlow - YouTube
TensorFlow Print : Print The Value Of A Tensor Object In TensorFlow - TensorFlow Tutorial.
Read more >
Using tf.Print() in TensorFlow - Towards Data Science
Today I'll show how TensorFlow's print statements work, and how to make the most of them, hopefully saving you some confusion along the...
Read more >
4- Save and Restore - Easy TensorFlow
We will start with saving and restoring two variables in TensorFlow. ... session to get the value of the variable a_out, b_out =...
Read more >
torch.save — PyTorch 1.13 documentation
A common PyTorch convention is to save tensors using .pt file extension. Note. PyTorch preserves storage sharing across serialization.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found