首页 > 解决方案 > Tensorboard 未在 Rstudio 中显示图表

问题描述

我正在尝试生成一个少数张量的图表作为 Tensorboard 的实验。但是,没有显示输出。以下是我的配置:

tensorflow::tf_config()

输出

TensorFlow v2.6.0(C:\Users\mohammed\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_init _.p ) Python v3.9(C:/Users/mohammed/AppData/Local/程序/Python/Python39/python.exe)

加载库

library(dplyr)
library(tensorflow)
library(keras)

tensorflow::tf_config()

mytf <- tf$compat$v1```


TF <- tf$compat$v1
tf$compat$v1$disable_eager_execution() # needed in TF2
# build a graph
a <-  TF$constant(5.0, name = "NumChildren")
b <-  TF$constant(6.0, name = "NumAdult")
c <- a*b
sess <- tf$compat$v1$Session()
# Evaluate tensor "C"
print(sess$run(c)) # should return 30

#  write the session graph 

Location <- "D:/FirstGraph"
WriteGraph <- TF$summary$FileWriter(paste0(Location,"/graphs"), sess$graph)
tf$keras$callbacks$TensorBoard(log_dir = WriteGraph)```

 
# Console Output

```<keras.callbacks_v1.TensorBoard>```

标签: rstudiotensorboardtensorflow2.x

解决方案


推荐阅读