vy007vikas / pytorch-actorcriticrl Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of DDPG algorithm for continuous action reinforcement learning problem.
PyTorch implementation of DDPG algorithm for continuous action reinforcement learning problem.
Traceback (most recent call last):
File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/main.py", line 38, in <module>
action = trainer.get_exploration_action(state)
File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/train.py", line 64, in get_exploration_action
action = self.actor.forward(state).detach()
File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/model.py", line 94, in forward
x = F.relu(self.fc1(state))
File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
result = self.forward(*input, **kwargs)
File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/modules/linear.py", line 54, in forward
return self._backend.Linear()(input, self.weight, self.bias)
File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/_functions/linear.py", line 10, in forward
output.addmm_(0, 1, input, weight.t())
RuntimeError: matrices expected, got 1D, 2D tensors at /Users/soumith/miniconda2/conda-bld/pytorch_1493756739997/work/torch/lib/TH/generic/THTensorMath.c:1232
Any suggestions with this error: ?
Traceback (most recent call last):
File "main.py", line 72, in
trainer.save_models(_ep)
File "/home/sayomakinwa/.mujoco2/mujoco-py/PyTorch-ActorCriticRL/train.py", line 115, in save_models
torch.save(self.target_actor.state_dict(), './Models/' + str(episode_count) + '_actor.pt')
File "/home/sayomakinwa/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 219, in save
return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
File "/home/sayomakinwa/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 142, in _with_file_like
f = open(f, mode)
FileNotFoundError: [Errno 2] No such file or directory: './Models/0_actor.pt'
Traceback (most recent call last)
36 state = np.float32(observation)
37
---> 38 action = trainer.get_exploration_action(state)
39 # if _ep%5 == 0:
40 # # validate every 5th episode
.../train.py in get_exploration_action(self, state)
62 """
63 state = Variable(torch.from_numpy(state))
---> 64 action = self.actor.forward(state).detach()
65 new_action = action.data.numpy() + (self.noise.sample() * self.action_lim)
66 return new_action
.../model.py in forward(self, state)
97 action = torch.tanh(self.fc4(x))
98
---> 99 action = action * self.action_lim
100
101 return action
TypeError: mul() received an invalid combination of arguments - got (numpy.int64), but expected one of:
I am writing to thank you for what you write in the README, which helps me totally understand the idea of DDPG. Thanks a lot
in train.py
loss_critic = F.smooth_l1_loss(y_predicted, y_expected)
self.critic_optimizer.zero_grad()
loss_critic.backward()
self.critic_optimizer.step()
Is it correct to set the gradients in the optimizer to zero after calculating the loss or should it be the other way around i.e. setting all gradients to zero, then taking the loss and performing an update?
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.