Giter VIP home page Giter VIP logo

pytorch-actorcriticrl's People

Contributors

vy007vikas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorch-actorcriticrl's Issues

Acknowledgment

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

mul() received an invalid combination of arguments

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:

  • (Tensor other)
    didn't match because some of the arguments have invalid types: (numpy.int64)
  • (Number other)
    didn't match because some of the arguments have invalid types: (numpy.int64)

FileNotFoundError: [Errno 2] No such file or directory: './Models/0_actor.pt'

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'

Wrong training ?

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?

RuntimeError: matrices expected, got 1D, 2D tensors

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.