ezliu / dream Goto Github PK
View Code? Open in Web Editor NEWDecoupled Reward-free ExplorAtion and Execution for Meta-reinforcement learning
Decoupled Reward-free ExplorAtion and Execution for Meta-reinforcement learning
I follow the example and execute
python3 main.py dream -b environment=\"miniworld_sign\" -c configs/default.json -c configs/miniworld.json
but I failed, it seems to be a device error.
Traceback (most recent call last):
File "/home/tianyun/research/rl-samples/dream/main.py", line 385, in <module>
main()
File "/home/tianyun/research/rl-samples/dream/main.py", line 250, in main
episode, _ = run_episode(
File "/home/tianyun/research/rl-samples/dream/main.py", line 55, in run_episode
action, next_hidden_state = policy.act(
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 91, in act
return self._dqn.act(state, prev_hidden_state=prev_hidden_state, test=test)
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 418, in act
q_values, hidden_state = self._Q([[state]], prev_hidden_state)
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 467, in forward
state_embedding, hidden_state = self._state_embedder(states, hidden_states)
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/embed.py", line 303, in forward
trajectory_embed, _ = self._trajectory_embedder(
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/embed.py", line 240, in forward
self._compute_contexts(trajectories))
File "/home/tianyun/research/rl-samples/dream/embed.py", line 160, in _compute_contexts
padded_transitions = nn.utils.rnn.pack_padded_sequence(
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/utils/rnn.py", line 245, in pack_padded_sequence
_VF._pack_padded_sequence(input, lengths, batch_first)
RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor
I try to only use CPU in main.py, but still fail, the error message is
Traceback (most recent call last):
File "/home/tianyun/research/rl-samples/dream/main.py", line 385, in <module>
main()
File "/home/tianyun/research/rl-samples/dream/main.py", line 250, in main
episode, _ = run_episode(
File "/home/tianyun/research/rl-samples/dream/main.py", line 55, in run_episode
action, next_hidden_state = policy.act(
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 91, in act
return self._dqn.act(state, prev_hidden_state=prev_hidden_state, test=test)
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 418, in act
q_values, hidden_state = self._Q([[state]], prev_hidden_state)
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/dqn.py", line 467, in forward
state_embedding, hidden_state = self._state_embedder(states, hidden_states)
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/embed.py", line 303, in forward
trajectory_embed, _ = self._trajectory_embedder(
File "/home/tianyun/anaconda3/envs/rl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/tianyun/research/rl-samples/dream/embed.py", line 240, in forward
self._compute_contexts(trajectories))
File "/home/tianyun/research/rl-samples/dream/embed.py", line 174, in _compute_contexts
transition_hidden_states = torch.cat(
RuntimeError: All input tensors must be on the same device. Received cuda:0 and cpu
then I only use CPU in embed.py, and I success to train it.
Is that a device bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.