Comments (1)
Fix for the first issue.
--- a/samples/a2c.py +++ b/samples/a2c.py @@ -93,10 +96,12 @@ if __name__ == "__main__": # model returns probability of actions model = Model(env.action_space.n, env.observation_space.shape[0]) + device="cpu" if cuda_enabled: model.cuda() + device = "cuda" - agent = ptan.agent.PolicyAgent(a3c_actor_wrapper(model), cuda=cuda_enabled) + agent = ptan.agent.PolicyAgent(a3c_actor_wrapper(model), device=device) exp_source = ptan.experience.ExperienceSource(env=env, agent=agent, steps_count=run.getint("learning", "n_steps")) optimizer = optim.RMSprop(model.parameters(), lr=run.getfloat("learning", "lr"))
But then I hit the next one:
python3 a2c.py -r runs/a2c/a2c_cartpole.ini Traceback (most recent call last): File "a2c.py", line 172, in for exp in exp_source: File "/home/simon/ptan-git/ptan/experience.py", line 82, in __iter__ states_actions, new_agent_states = self.agent(states_input, agent_states) File "/home/simon/ptan-git/ptan/agent.py", line 129, in __call__ probs_v = self.model(states) File "a2c.py", line 64, in _wrap x = model(x) File "/home/simon/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__ result = self.forward(*input, **kwargs) File "a2c.py", line 53, in forward x = self.fc1(x) File "/home/simon/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__ result = self.forward(*input, **kwargs) File "/home/simon/.local/lib/python3.5/site-packages/torch/nn/modules/linear.py", line 55, in forward return F.linear(input, self.weight, self.bias) File "/home/simon/.local/lib/python3.5/site-packages/torch/nn/functional.py", line 1024, in linear return torch.addmm(bias, input, weight.t()) RuntimeError: Expected object of type torch.FloatTensor but found type torch.DoubleTensor for argument #4 'mat1'
from ptan.
Related Issues (20)
- Where to find and how to restore dqn_speedup model? HOT 2
- ExperienceReplayBuffer stores second-last transition twice HOT 2
- Re-open "ExperienceReplayBuffer stores second-last transition twice" HOT 2
- Code run time HOT 1
- It requires pytorch 1.3.0, but I can't download it HOT 8
- Which PyTorch version? HOT 2
- unable to install ptan HOT 1
- [FR] Possibility of rendering and testing the models after training.
- Weights should not affect probabilities in PrioReplayBuffer
- Unable to install ptan via pip (old versions of dependencies not available) HOT 2
- Is it possible to support PyTorch 1.5? HOT 3
- Can not install ptan HOT 1
- Examples in chapters 8 and 9 don't run HOT 5
- Not able to run ptan.ignite when custom events inherit from enum.Enum HOT 4
- Can not install ptan because of Pytorch version HOT 4
- Pytorch version 1.7.1
- Multi agent support
- atari-py is no longer supported
- Outdated Experience Source
- AttributeError: module 'ignite' has no attribute 'EndOfEpisodeHandler' - still exists in ptan version 0.7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ptan.