agents icon indicating copy to clipboard operation
agents copied to clipboard

Speed Bottleneck due to dataset

Open jacklu333333 opened this issue 3 years ago • 0 comments

Hi, I am using TFUniformReplayBuffer with DynamicEpisodeDriverwith the former config device as GPU. However, in mytf.profile` it shows that the following code is actually running on the CPU.

dataset = replay_buffer.as_dataset(
    num_parallel_calls=16, 
    sample_batch_size=batch_size,
    num_steps=n_step_update + 1,
    ).prefetch(10)
iterator = iter(dataset)
experience, buffer_info = next(iterator)
train_loss = agent.train(experience)

Is there any way that I can make the iteration of the dataset run in the GPU instead of sending them back and forth?

jacklu333333 avatar Jan 07 '23 06:01 jacklu333333