load.py
def load(path, iepisode, field):
    """Adapted from `dataset.py` so we can sample goal images. Just including
    some logic to extract the episode automatically based on the index
    `iepisode`, so we don't need to know the length in advance.
    """
    field_path = os.path.join(path, field)
    data_list = [os.path.join(field_path, x) for x in os.listdir(field_path)]
    fname = [x for x in data_list if f'{iepisode:06d}' in x]
    assert len(fname) == 1, fname
    fname = fname[0]
    return pickle.load(open(fname, 'rb'))
Adapted from `dataset.py` so we can sample goal images. Just including
    some logic to extract the episode automatically based on the index
    `iepisode`, so we don't need to know the length in advance.
    
Adapted from `dataset.py` so we can sample goal images. Just including
some logic to extract the episode automatically based on the index
`iepisode`, so we don't need to know the length in advance.
Adapted from ` dataset . py ` so we can sample goal images . Just including some logic to extract the episode automatically based on the index ` iepisode ` so we don ' t need to know the length in advance .
def load(path, iepisode, field):
    field_path = os.path.join(path, field)
    data_list = [os.path.join(field_path, x) for x in os.listdir(field_path)]
    fname = [x for x in data_list if f'{iepisode:06d}' in x]
    assert len(fname) == 1, fname
    fname = fname[0]
    return pickle.load(open(fname, 'rb'))
def load ( path , iepisode , field ) : field_path = os . path . join ( path , field ) data_list = [ os . path . join ( field_path , x ) for x in os . listdir ( field_path ) ] fname = [ x for x in data_list if f'{iepisode:06d}' in x ] assert len ( fname ) == 1 , fname fname = fname [ 0 ] return pickle . load ( open ( fname , 'rb' ) )
Adapted from `dataset.py` so we can sample goal images.
Adapted from ` dataset . py ` so we can sample goal images .
"""Adapted from `dataset.py` so we can sample goal images. Just including
    some logic to extract the episode automatically based on the index
    `iepisode`, so we don't need to know the length in advance.
    """
path
iepisode
field