多巴胺-rainbow_agent_test.py中的内存错误和属性错误

时间:2018-08-29 21:22:23

标签: python tensorflow

成功使用pip和Anaconda在Windows上安装了多巴胺和atari,在运行示例Rainbow_agent_test.py文件时出现以下错误:

(dopamine) E:\devcodes\python\dopamine\dopamine-master>python -um tests.agents.r
ainbow.rainbow_agent_test
......2018-08-30 02:40:37.571762: W T:\src\github\tensorflow\tensorflow\core\fra
mework\op_kernel.cc:1275] OP_REQUIRES failed at strided_slice_op.cc:105 : Invali
d argument: slice index 0 of dimension 0 out of bounds.
..........2018-08-30 02:40:39.199831: W T:\src\github\tensorflow\tensorflow\core
\framework\op_kernel.cc:1275] OP_REQUIRES failed at strided_slice_op.cc:105 : In
valid argument: Index out of range using input dim 0; input has only 0 dims
2018-08-30 02:40:39.199831: W T:\src\github\tensorflow\tensorflow\core\framework
\op_kernel.cc:1275] OP_REQUIRES failed at strided_slice_op.cc:105 : Invalid argu
ment: Index out of range using input dim 0; input has only 0 dims
..WARNING:tensorflow:From E:\devcodes\python\dopamine\dopamine-master\dopamine\a
gents\rainbow\rainbow_agent.py:264: softmax_cross_entropy_with_logits (from tens
orflow.python.ops.nn_ops) is deprecated and will be removed in a future version.

Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

...EEEE.
======================================================================
ERROR: testStepEval (__main__.RainbowAgentTest)
Tests the functionality of agent.step() in eval mode.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 430, in testStepEval
    agent = self._create_test_agent(sess)
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 345, in _create_test_agent
    epsilon_decay_period=self._epsilon_decay_period)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 126, in __init__
    optimizer=self.optimizer)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\dqn\dqn_agen
t.py", line 151, in __init__
    self._replay = self._build_replay_buffer(use_staging)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 191, in _build_replay_buffer
    gamma=self.gamma)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 289, in __init__
    extra_storage_types=extra_storage_types)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 78, in __init__
    observation_dtype=observation_dtype)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 157, in __init__
    self._create_storage()
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 173, in _create_storage
    array_shape, dtype=storage_element.type)
MemoryError:
  In call to configurable 'WrappedPrioritizedReplayBuffer' (<function WrappedPri
oritizedReplayBuffer.__init__ at 0x00000053296C86A8>)
  In call to configurable 'DQNAgent' (<function DQNAgent.__init__ at 0x000000532
96B5620>)
  In call to configurable 'RainbowAgent' (<function RainbowAgent.__init__ at 0x0
0000053296BBD08>)

======================================================================
ERROR: testStepTrain (__main__.RainbowAgentTest)
Test the functionality of agent.step() in train mode.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 467, in testStepTrain
    agent = self._create_test_agent(sess)
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 345, in _create_test_agent
    epsilon_decay_period=self._epsilon_decay_period)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 126, in __init__
    optimizer=self.optimizer)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\dqn\dqn_agen
t.py", line 151, in __init__
    self._replay = self._build_replay_buffer(use_staging)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 191, in _build_replay_buffer
    gamma=self.gamma)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 289, in __init__
    extra_storage_types=extra_storage_types)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 78, in __init__
    observation_dtype=observation_dtype)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 157, in __init__
    self._create_storage()
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 173, in _create_storage
    array_shape, dtype=storage_element.type)
MemoryError:
  In call to configurable 'WrappedPrioritizedReplayBuffer' (<function WrappedPri
oritizedReplayBuffer.__init__ at 0x00000053296C86A8>)
  In call to configurable 'DQNAgent' (<function DQNAgent.__init__ at 0x000000532
96B5620>)
  In call to configurable 'RainbowAgent' (<function RainbowAgent.__init__ at 0x0
0000053296BBD08>)

======================================================================
ERROR: testStoreTransitionWithPrioritizedSamplingy (__main__.RainbowAgentTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 518, in testStoreTransitionWithPrioritizedSamplingy
    sess, num_actions=4, replay_scheme='prioritized')
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 126, in __init__
    optimizer=self.optimizer)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\dqn\dqn_agen
t.py", line 151, in __init__
    self._replay = self._build_replay_buffer(use_staging)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 191, in _build_replay_buffer
    gamma=self.gamma)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 289, in __init__
    extra_storage_types=extra_storage_types)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 78, in __init__
    observation_dtype=observation_dtype)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 157, in __init__
    self._create_storage()
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 173, in _create_storage
    array_shape, dtype=storage_element.type)
MemoryError:
  In call to configurable 'WrappedPrioritizedReplayBuffer' (<function WrappedPri
oritizedReplayBuffer.__init__ at 0x00000053296C86A8>)
  In call to configurable 'DQNAgent' (<function DQNAgent.__init__ at 0x000000532
96B5620>)
  In call to configurable 'RainbowAgent' (<function RainbowAgent.__init__ at 0x0
0000053296BBD08>)

======================================================================
ERROR: testStoreTransitionWithUniformSampling (__main__.RainbowAgentTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "E:\devcodes\python\dopamine\dopamine-master\tests\agents\rainbow\rainbow
_agent_test.py", line 504, in testStoreTransitionWithUniformSampling
    sess, num_actions=4, replay_scheme='uniform')
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 126, in __init__
    optimizer=self.optimizer)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\dqn\dqn_agen
t.py", line 151, in __init__
    self._replay = self._build_replay_buffer(use_staging)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\agents\rainbow\rain
bow_agent.py", line 191, in _build_replay_buffer
    gamma=self.gamma)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\utils.py", li
ne 48, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "D:\Softwares\Anaconda3\envs\dopamine\lib\site-packages\gin\config.py", l
ine 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 289, in __init__
    extra_storage_types=extra_storage_types)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\prior
itized_replay_buffer.py", line 78, in __init__
    observation_dtype=observation_dtype)
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 157, in __init__
    self._create_storage()
  File "E:\devcodes\python\dopamine\dopamine-master\dopamine\replay_memory\circu
lar_replay_buffer.py", line 173, in _create_storage
    array_shape, dtype=storage_element.type)
AttributeError: __init__
  In call to configurable 'WrappedPrioritizedReplayBuffer' (<function WrappedPri
oritizedReplayBuffer.__init__ at 0x00000053296C86A8>)
  In call to configurable 'DQNAgent' (<function DQNAgent.__init__ at 0x000000532
96B5620>)
  In call to configurable 'RainbowAgent' (<function RainbowAgent.__init__ at 0x0
0000053296BBD08>)

----------------------------------------------------------------------
Ran 26 tests in 9.781s

FAILED (errors=4)

这是否是在Windows上安装的结果?如果没有,该如何运行该脚本?

或者,是否还有其他建议的“ Hello world”脚本可以在多巴胺库上运行?

0 个答案:

没有答案