agents.ipynb, MemoryError: In call to configurable 'WrappedReplayBuffer'
- Dominant language
- Jupyter Notebook
- Stars
- 10.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
I think the replay_capacity should be to 1000? but i could't find which variable control this parameter?
INFO:tensorflow:Creating MyRandomDQNAgent agent with the following parameters:
INFO:tensorflow: gamma: 0.990000
INFO:tensorflow: update_horizon: 1.000000
INFO:tensorflow: min_replay_history: 20000
INFO:tensorflow: update_period: 4
INFO:tensorflow: target_update_period: 8000
INFO:tensorflow: epsilon_train: 0.010000
INFO:tensorflow: epsilon_eval: 0.001000
INFO:tensorflow: epsilon_decay_period: 250000
INFO:tensorflow: tf_device: /cpu:*
INFO:tensorflow: use_staging: True
INFO:tensorflow: optimizer:
INFO:tensorflow:Creating a OutOfGraphReplayBuffer replay memory with the following parameters:
INFO:tensorflow: observation_shape: (84, 84)
INFO:tensorflow: stack_size: 4
INFO:tensorflow: replay_capacity: 1000000
INFO:tensorflow: batch_size: 32
INFO:tensorflow: update_horizon: 1
INFO:tensorflow: gamma: 0.990000
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
in
28 training_steps=10,
29 evaluation_steps=10,
---> 30 max_steps_per_episode=100)
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1030 scope_info = " in scope '{}'".format(scope_str) if scope_str else ''
1031 err_str = err_str.format(name, fn, scope_info)
-> 1032 utils.augment_exception_message_and_reraise(e, err_str)
1033
1034 return wrapper
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\utils.py in augment_exception_message_and_reraise(exception, message)
46 if six.PY3:
47 ExceptionProxy.__qualname__ = type(exception).__qualname__
---> 48 six.raise_from(proxy.with_traceback(exception.__traceback__), None)
49 else:
50 six.reraise(proxy, None, sys.exc_info()[2])
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\six.py in raise_from(value, from_value)
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1007
1008 try:
-> 1009 return fn(*new_args, **new_kwargs)
1010 except Exception as e: # pylint: disable=broad-except
1011 err_str = ''
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\atari\run_experiment.py in __init__(self, base_dir, create_agent_fn, create_environment_fn, game_name, sticky_actions, checkpoint_file_prefix, logging_file_prefix, log_every_n, num_iterations, training_steps, evaluation_steps, max_steps_per_episode)
164 config=tf.ConfigProto(allow_soft_placement=True))
165 self._agent = create_agent_fn(self._sess, self._environment,
--> 166 summary_writer=self._summary_writer)
167 self._summary_writer.add_graph(graph=tf.get_default_graph())
168 self._sess.run(tf.global_variables_initializer())
in create_random_dqn_agent(sess, environment, summary_writer)
16 def create_random_dqn_agent(sess, environment, summary_writer=None):
17 """The Runner class will expect a function of this type to create an agent."""
---> 18 return MyRandomDQNAgent(sess, num_actions=environment.action_space.n)
19
20 # Create the runner class with this agent. We use very small numbers of steps
in __init__(self, sess, num_actions)
6 def __init__(self, sess, num_actions):
7 """This maintains all the DQN default argument values."""
----> 8 super(MyRandomDQNAgent, self).__init__(sess, num_actions)
9
10 def step(self, reward, observation):
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1030 scope_info = " in scope '{}'".format(scope_str) if scope_str else ''
1031 err_str = err_str.format(name, fn, scope_info)
-> 1032 utils.augment_exception_message_and_reraise(e, err_str)
1033
1034 return wrapper
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\utils.py in augment_exception_message_and_reraise(exception, message)
46 if six.PY3:
47 ExceptionProxy.__qualname__ = type(exception).__qualname__
---> 48 six.raise_from(proxy.with_traceback(exception.__traceback__), None)
49 else:
50 six.reraise(proxy, None, sys.exc_info()[2])
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\six.py in raise_from(value, from_value)
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1007
1008 try:
-> 1009 return fn(*new_args, **new_kwargs)
1010 except Exception as e: # pylint: disable=broad-except
1011 err_str = ''
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\agents\dqn\dqn_agent.py in __init__(self, sess, num_actions, observation_shape, observation_dtype, stack_size, gamma, update_horizon, min_replay_history, update_period, target_update_period, epsilon_fn, epsilon_train, epsilon_eval, epsilon_decay_period, tf_device, use_staging, max_tf_checkpoints_to_keep, optimizer, summary_writer, summary_writing_frequency)
174 self.state_ph = tf.placeholder(observation_dtype, state_shape,
175 name='state_ph')
--> 176 self._replay = self._build_replay_buffer(use_staging)
177
178 self._build_networks()
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\agents\dqn\dqn_agent.py in _build_replay_buffer(self, use_staging)
261 use_staging=use_staging,
262 update_horizon=self.update_horizon,
--> 263 gamma=self.gamma)
264
265 def _build_target_q_op(self):
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1030 scope_info = " in scope '{}'".format(scope_str) if scope_str else ''
1031 err_str = err_str.format(name, fn, scope_info)
-> 1032 utils.augment_exception_message_and_reraise(e, err_str)
1033
1034 return wrapper
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\utils.py in augment_exception_message_and_reraise(exception, message)
46 if six.PY3:
47 ExceptionProxy.__qualname__ = type(exception).__qualname__
---> 48 six.raise_from(proxy.with_traceback(exception.__traceback__), None)
49 else:
50 six.reraise(proxy, None, sys.exc_info()[2])
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\six.py in raise_from(value, from_value)
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\gin\config.py in wrapper(*args, **kwargs)
1007
1008 try:
-> 1009 return fn(*new_args, **new_kwargs)
1010 except Exception as e: # pylint: disable=broad-except
1011 err_str = ''
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\replay_memory\circular_replay_buffer.py in __init__(self, observation_shape, stack_size, use_staging, replay_capacity, batch_size, update_horizon, gamma, wrapped_memory, max_sample_attempts, extra_storage_types, observation_dtype)
705 update_horizon, gamma, max_sample_attempts,
706 observation_dtype=observation_dtype,
--> 707 extra_storage_types=extra_storage_types)
708
709 self.create_sampling_ops(use_staging)
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\replay_memory\circular_replay_buffer.py in __init__(self, observation_shape, stack_size, replay_capacity, batch_size, update_horizon, gamma, max_sample_attempts, extra_storage_types, observation_dtype)
156 else:
157 self._extra_storage_types = []
--> 158 self._create_storage()
159 self.add_count = np.array(0)
160 self.invalid_range = np.zeros((self._stack_size))
c:\users\gyang\my_prodect\dopamine-env\lib\site-packages\dopamine\replay_memory\circular_replay_buffer.py in _create_storage(self)
172 array_shape = [self._replay_capacity] + list(storage_element.shape)
173 self._store[storage_element.name] = np.empty(
--> 174 array_shape, dtype=storage_element.type)
175
176 def get_add_args_signature(self):
MemoryError:
In call to configurable 'WrappedReplayBuffer' ()
In call to configurable 'DQNAgent' ()
In call to configurable 'Runner' ()
Contributor guide
Assessment
This issue has not been assessed yet.