Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helinwang/tfsum
Enable TensorBoard for TensorFlow Go API
https://github.com/helinwang/tfsum
golang tensorboard tensorboard-visualizations tensorflow
Last synced: 8 days ago
JSON representation
Enable TensorBoard for TensorFlow Go API
- Host: GitHub
- URL: https://github.com/helinwang/tfsum
- Owner: helinwang
- License: bsd-3-clause
- Created: 2016-12-11T05:12:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T20:50:08.000Z (over 7 years ago)
- Last Synced: 2024-10-16T09:28:54.382Z (29 days ago)
- Topics: golang, tensorboard, tensorboard-visualizations, tensorflow
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 33
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Tensorflow provides golang api for model training and inference, however currently tensorboard is only supported when using python.
This repository enables using tensorboard with tensorflow golang api. `tfsum.Writer` writes file that tensorboard could understand.
Before using the following piece of code, you have to build tensorflow golang api: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/go/README.md
### Example
```
package mainimport (
"fmt""github.com/helinwang/tfsum"
tf "github.com/tensorflow/tensorflow/tensorflow/go"
)func main() {
step := 0
w := &tfsum.Writer{Dir: "./tf-log", Name: "train"}
var s *tf.Session
var g *tf.Graph
var input *tf.Tensor
sum, err := s.Run(
map[tf.Output]*tf.Tensor{
g.Operation("input").Output(0): input,
},
[]tf.Output{
g.Operation("MergeSummary/MergeSummary").Output(0),
},
[]*tf.Operation{
g.Operation("train_step"),
})
if err != nil {
fmt.Println(err)
}
err = w.AddEvent(sum[0].Value().(string), int64(step))
if err != nil {
fmt.Println(err)
}
}
```
Then run tensorboard normally
```
tensorboard --logdir=./tf-log
```