Hi, contributing this example of how to read the atari files directly, in case anyone wants to do that.
Note that the data is stored in the same temporal sequence it was logged, as you can see by watching the replay.
import gzip
import cv2
import numpy as np
STORE_FILENAME_PREFIX = '$store$_'
ELEMS = ['observation', 'action', 'reward', 'terminal']
if __name__ == '__main__':
data = {}
data_dir = '/home/duane/data/dqn/Breakout/1/replay_logs/'
suffix = 0
for elem in ELEMS:
filename = f'{data_dir}{STORE_FILENAME_PREFIX}{elem}_ckpt.{suffix}.gz'
with open(filename, 'rb') as f:
with gzip.GzipFile(fileobj=f) as infile:
data[elem] = np.load(infile)
for obs in data['observation']:
cv2.imshow('obs', obs)
cv2.waitKey(20)
Hi, contributing this example of how to read the atari files directly, in case anyone wants to do that.
Note that the data is stored in the same temporal sequence it was logged, as you can see by watching the replay.