diff --git a/pyrobolearn/algos/updater.py b/pyrobolearn/algos/updater.py index b4e1d06..dbad108 100644 --- a/pyrobolearn/algos/updater.py +++ b/pyrobolearn/algos/updater.py @@ -232,7 +232,7 @@ class Updater(object): raise TypeError("Expecting the given ticks to be a dictionary, instead got: {}".format(type(ticks))) # check first the items already present in the ticks - for key, value in ticks.iteritems(): + for key, value in ticks.items(): # check that the key is a Loss or ParamaterUpdater if not isinstance(key, (Loss, ParameterUpdater)): raise TypeError("Expecting the given key for the tick to be an instance of `Loss` or " diff --git a/pyrobolearn/storages/er.py b/pyrobolearn/storages/er.py index 0a112cb..b67d42c 100644 --- a/pyrobolearn/storages/er.py +++ b/pyrobolearn/storages/er.py @@ -380,7 +380,7 @@ class ExperienceReplay(DictStorage): # ExperienceReplayStorage(DictStorage): batch = {} # go through each attribute in the and sample from the tensors - for key, value in self.iteritems(): + for key, value in self.items(): if isinstance(value, list): # value = list of tensors batch[key] = [val[indices] for val in value] else: # value = tensor diff --git a/pyrobolearn/storages/storage.py b/pyrobolearn/storages/storage.py index f7ffbed..1722594 100644 --- a/pyrobolearn/storages/storage.py +++ b/pyrobolearn/storages/storage.py @@ -686,7 +686,7 @@ class Batch(DictStorage): # print other variables tmp = {'states', 'actions', 'rewards', 'masks', 'returns'} - for key, value in kwargs.iteritems(): + for key, value in kwargs.items(): if key not in tmp: print("{}: {}".format(key, value)) @@ -1166,7 +1166,7 @@ class RolloutStorage(DictStorage): # TODO: think about when multiple policies: # print("Indices: {}".format(indices)) # go through each attribute and sample from the tensors - for key, value in self.iteritems(): + for key, value in self.items(): # print("batch - add key: {}".format(key)) if isinstance(value, list): # value = list of tensors batch[key] = [sample(val, indices) for val in value] # [[I, *shape] for each shape] diff --git a/pyrobolearn/worlds/world.py b/pyrobolearn/worlds/world.py index 0ab556f..0dc2982 100644 --- a/pyrobolearn/worlds/world.py +++ b/pyrobolearn/worlds/world.py @@ -269,7 +269,7 @@ class World(object): world = self.__class__(simulator=simulator, gravity=gravity) # load bodies in world - for id_, items in self.ids.iteritems(): + for id_, items in self.ids.items(): if not isinstance(items, list): items = [items] for item in items: