I'm reading Deep Learning with R, in Chapter 7, there's an example of tensorboard callback, but when I run the code,
callbacks = list(
callback_tensorboard(
log_dir = "my_log_dir",
histogram_freq = 1,
embeddings_freq = 1
)
)
then fit, this error occured:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: To visualize embeddings, embeddings_data must be provided.
In the python version of keras, the Tensorboard callback has a `embeddings_data' parameter, and when embeddings_freq > 0, this must be set, but it doesn't exist in the R version
Thanks for reporting this! Fix is here: https://github.com/rstudio/keras/commit/d478ad6998266320c401f6cb5a6d200189fc3006
Could you re-install with devtools::install_github("rstudio/keras") and let us know if that fixes the issue on your end?
I tried but still casting the same error. At least at GPU version tensorflow backend.
I am no longer seeing this error so I think we need to back up and have you provide us with the full set of code you are running along with the output of the following:
devtools::session_info()
tensorflow::tf_config()
keras:::keras_version()
I am getting the same error in Python, also with a Tensorflow-GPU back end. This is while running the example from section 7.2.2 in the Deep Learning With Python book.
I think you need to simply remove the embeddings_freq parameter from the call as it now requires embeddings_data to be passed as well and I'm not sure what the correct semantics for that are (I can't seem to get it to work and there isn't documentation that I can find on how to use it).
Okay, but that doesn't exactly fix the problem, it just removes the part that was causing a problem. Without that argument nothing gets embedded.
That's just the callback, - embeddings themselves are not affected...
But it seems like there was a PR changing related behavior in Keras 24 days ago (before, you could just pass embeddings_freq standalone):
https://github.com/keras-team/keras/pull/7766
We'll provide an R example how to use that.
In the meantime, see
https://github.com/keras-team/keras/blob/master/examples/tensorboard_embeddings_mnist.py
We have an example here now:
https://github.com/rstudio/keras/blob/master/vignettes/examples/mnist_cnn_embeddings.R
Most helpful comment
We have an example here now:
https://github.com/rstudio/keras/blob/master/vignettes/examples/mnist_cnn_embeddings.R