This model is built using TensorFlow.js Node.js implementation and it's using the DDQN algorithm to play the Dino Chrome game. Browser automation is done using Puppeteer.
-
Clone the repository: git clone https://github.com/gajojr/tfjs-dino-player.git
-
Change to the project directory: cd tfjs-dino-player
-
Install the dependencies: npm install
-
Clone the Dino Chrome game repository: git clone https://github.com/wayou/t-rex-runner.git
-
Install
http-server
globally: npm i -g http-server -
Change to the
t-rex-runner
directory: cd t-rex-runner -
Start the
http-server
in thet-rex-runner
directory: http-server -
Open another command line in the
tfjs-dino-player
directory. -
Run the Dino bot with the desired mode:
- To train the model, run:
node dino-bot.js --train
- To play the game, run:
node dino-bot.js --play