tychovdo / pacmandqn Goto Github PK
View Code? Open in Web Editor NEWDeep Reinforcement Learning in Pac-man
Deep Reinforcement Learning in Pac-man
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?
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)
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!
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.
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.
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
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.