K-means example code crashing

Hi guys,

The rollout/play snippet doesn’t seem to work. It crashes because it expects obs['vector'] in the viewer, but that doesn’t seem to be part of the obs. I had to add the following hack in trajectory_display.py at line 356 to make it work:

        if 'vector' not in obs:

Or am I doing something wrong?

I also seem to be getting the following error, seemingly every time when an episode is completed:

100%|█████████████████████████████████████████████████████████████████████████████████████| 209/209 [00:00<00:00, 2781.29it/s]
Exception in thread QueueManagerThread:
Traceback (most recent call last):
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/threading.py", line 926, in _bootstrap_inner
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/concurrent/futures/process.py", line 440, in _queue_management_worker
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/concurrent/futures/process.py", line 333, in shutdown_worker
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/multiprocessing/queues.py", line 129, in put_nowait
    return self.put(obj, False)
  File "/home/xxx/apps/miniconda3/envs/minerl/lib/python3.7/multiprocessing/queues.py", line 81, in put
    assert not self._closed, "Queue {0!r} has been closed".format(self)
AssertionError: Queue <concurrent.futures.process._SafeQueue object at 0x7f0ac69a2550> has been closed

this is literally just doing this:

import gym
import minerl
import numpy as np

from sklearn.cluster import KMeans

data = minerl.data.make('MineRLTreechopVectorObf-v0')
for _, act, _, _, _ in data.batch_iter(batch_size=16, seq_len=32, num_epochs=2, preload_buffer_size=20):

Any idea what could be causing this?

ok, looks like it’s caused by a faulty cleanup. I fiddled around with the code and now it “works” but I have no idea if that will break something else. I’m on Arch Linux x86_64 5.7.7-arch1-1, using python=3.7 if that helps.