swopper050 / foundations-drl Goto Github PK
View Code? Open in Web Editor NEWImplementing the base algorithms of Deep Reinforcement Learning in Python
Implementing the base algorithms of Deep Reinforcement Learning in Python
Hi,
Thank you so much for writing an excellent book and provided code. I am just learning the ropes here.
I tried running simple REINFORCE algorithm as suggested in the github page. There are already bunch of issues with the versions used in requirements.txt. Especially Pytorch version which seem quite old and need python version 3.6.
Visual code no longer supports the version 3.6 for debugging
python train_agent.py --env-name CartPole-v0 --algorithm reinforce --save-name cartpole_v0
Anyway I was able to install all the required versions suggested in requiremets.txt
However I got the following error
Traceback (most recent call last): File "train_agent.py", line 85, in <module> main(args) File "train_agent.py", line 51, in main render=args.render, File "/Users/user1/Documents/rl/foundations-drl/algorithms/reinforce/reinforce_trainer.py", line 56, in train_agent action = agent.act(obs, deterministic=False) File "/Users/user1/Documents/rl/foundations-drl/algorithms/reinforce/discrete_reinforce_agent.py", line 99, in act logits = self.forward(torch.from_numpy(np.asarray(observation[0]))) File "/Users/user1/Documents/rl/foundations-drl/algorithms/reinforce/discrete_reinforce_agent.py", line 84, in forward return self.net(X) File "/Users/user1/anaconda3/envs/rl2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/Users/user1/anaconda3/envs/rl2/lib/python3.6/site-packages/torch/nn/modules/container.py", line 119, in forward input = module(input) File "/Users/user1/anaconda3/envs/rl2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/Users/user1/anaconda3/envs/rl2/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 94, in forward return F.linear(input, self.weight, self.bias) File "/Users/user1/anaconda3/envs/rl2/lib/python3.6/site-packages/torch/nn/functional.py", line 1753, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: both arguments to matmul need to be at least 1D, but they are 0D and 2D
Please let me know if you have updated version of the code
regards,
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.