Best solution I have found so far for my issue is to make it explicitly load the data set into RAM to avoid pickling. This does the trick, but does require a lot of RAM.
dataset = dataset.flatten_indices()

Not sure if it will solve your problem!