Git Product home page Git Product logo

pacmandqn's People

Contributors

chenghuzi avatar tychovdo 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

pacmandqn's Issues

Input to the network?

I was trying to figure out the input that goes into the DQN? Is it the current frame or a combination of coordinates like pacman's position, wall coordinates etc?

ValueError:could not broadcast input array from shape(7,14) into shape(7,7)

Hi Tychovdo,

I am trying to learn from your PacmanDQN for my AI class.
I cloned your full code and tried to run the example:python3 pacman.py -p PacmanDQN -n 6000 -x 5000 -l smallGrid.
But it shows:ValueError:could not broadcast input array from shape(7,14) into shape(7,7).
Here it is error details:
c:\Git\8\trunk>python pacman.py -p PacmanDQN -n 6000 -x 5000 -l smallGrid
Initialise DQN Agent
Traceback (most recent call last):
File "pacman.py", line 744, in
runGames(**args)
File "pacman.py", line 704, in runGames
game.run()
File "c:\Git\8\trunk\game.py", line 647, in run
agent.registerInitialState(self.state.deepCopy())
File "c:\Git\8\trunk\pacmanDQN_Agents.py", line 365, in registerInitialState
self.current_state = self.getStateMatrices(state)
File "c:\Git\8\trunk\pacmanDQN_Agents.py", line 344, in getStateMatrices
observation[0] = getWallMatrix(state)
ValueError: could not broadcast input array from shape (7,14) into shape (7,7)

How to render/display the game?

Hi,

This project is very interesting. I am wondering how to display the game during training or testing?

I think it may be related to the saveFrame function in the graphicsDisplay.py file. However, I fail to display the game.

Could you kindly give me some instructions?

Thanks a lot!

TypeError: '>=' not supported between instances of 'dict' and 'int'

after calling python pacman.py I am getting

(pacman) mustafa@mstf-ubuntu:~/workspace/tmp/PacmanDQN$ python pacman.py 
Traceback (most recent call last):
  File "pacman.py", line 744, in <module>
    runGames(**args)
  File "pacman.py", line 704, in runGames
    game.run()
  File "/home/mustafa/workspace/tmp/PacmanDQN/game.py", line 735, in run
    action = agent.getAction(observation)
  File "/home/mustafa/workspace/tmp/PacmanDQN/keyboardAgents.py", line 44, in getAction
    legal = state.getLegalActions(self.index)
  File "pacman.py", line 104, in getLegalActions
    return GhostRules.getLegalActions(self, agentIndex)
  File "pacman.py", line 414, in getLegalActions
    conf = state.getGhostState(ghostIndex).configuration
  File "pacman.py", line 165, in getGhostState
    if agentIndex == 0 or agentIndex >= self.getNumAgents():
TypeError: '>=' not supported between instances of 'dict' and 'int'

I am running Python 3.6.3 from Anaconda.

Doesn't learn

I run this code and found that the Q Value can't increase. I guess it was because there's no target Q network with fixed parameters.

Using record feature

Hi How can I use the -r feature to record the video of the result and display it on the online colabs server.
Problem is we want to record the output either by taking screenshots of the server or recording directly.

With screenshots
game.run() if I use pyvirtualdisplay the issue arrives if I place my screenshot code below this then my pacman window closes and then i take the screenshot so no game screenshot.

Then I saw there is a record feature inside your code but I am unable to use it could you please guide it will be great.

Thanks in Advance

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.