I wonder if it's possible to implement the from_generator method. I was trying to implement similar to what's in keras, but got a C stack usage error. Here's the minimal example:
library(tensorflow)
library(tfdatasets)
gen <- function() {
i <- 0
function() {
i <<- i + 1
i
}
}
gen2 <- function() reticulate::py_iterator(gen())
dataset <- tf$data$Dataset$from_generator(generator = gen2, output_types = tuple(tf$float64))
iterator <- dataset$make_one_shot_iterator()
the_next <- iterator$get_next()
sess <- tf$Session()
the_next[[1]]$eval(session = sess)
I wonder if it's possible to implement the
from_generator
method. I was trying to implement similar to what's in keras, but got a C stack usage error. Here's the minimal example: