paperspace / dinoruntutorial Goto Github PK
View Code? Open in Web Editor NEWAccompanying code for Paperspace tutorial "Build an AI to play Dino Run"
Home Page: https://blog.paperspace.com/dino-run
License: MIT License
Accompanying code for Paperspace tutorial "Build an AI to play Dino Run"
Home Page: https://blog.paperspace.com/dino-run
License: MIT License
Unable to use chromedriver in paperspace, i have uploaded the chromedriver in paperspace and i use a macos. Please help
from selenium import webdriver
driver = webdriver.Chrome('chromedriver')
Thanks for this article. I didn’t understand how did you know Runner
is for checking the state like current score, gamer running or not, crashed or not, resume, start, …
Is that present in every canvas game? Mean did it work only for chrome://dino ? How can I find out Runner kind of variable to check the game state in other websites?
I start the code in a virtual environment of python and i get the following error:
How can I fix the permission conflict?
`(ENV) te@te-ThinkPad-T460s:~/Programming/Python/DinoRunTutorial$ python3 Main.py
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/te/Programming/Python/DinoRunTutorial/ENV/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.6/subprocess.py", line 729, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/bin'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Main.py", line 372, in
playGame(observe=False);
File "Main.py", line 362, in playGame
game = Game()
File "Main.py", line 66, in init
self._driver = webdriver.Chrome(executable_path = chrome_driver_path,chrome_options=chrome_options)
File "/home/te/Programming/Python/DinoRunTutorial/ENV/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init
self.service.start()
File "/home/te/Programming/Python/DinoRunTutorial/ENV/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 88, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'bin' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home`
The 3 layers of conv with proposed values of stride , pooling .ect. leads the feature map to be small too fast ( supposed 80*80 input). is there any other settings I missed ?
Thanks a lot
I am experiencing the above the error when I run the command, I copied the objects folder to the directory already. I am running it on windows 10 and the chrome browser did pop up and the game started but in the command prompt shows the error below.
`C:\Users\Tom\Desktop\Chrome-Dino-Reinforcement-Learning-master\DinoRunTutorial-master>jupyter nbconvert --execute "Reinforcement Learning Dino Run.ipynb"
[NbConvertApp] Converting notebook Reinforcement Learning Dino Run.ipynb to html
[NbConvertApp] Executing notebook with kernel: python3
�[1;31m---------------------------------------------------------------------------�[0m
�[1;31mFileNotFoundError�[0m Traceback (most recent call last)
�[1;32m�[0m in �[0;36m�[1;34m�[0m
�[1;32m----> 1�[1;33m �[0mplayGame�[0m�[1;33m(�[0m�[0mobserve�[0m�[1;33m=�[0m�[1;32mFalse�[0m�[1;33m)�[0m�[1;33m;�[0m�[1;33m�[0m�[0m
�[0m
�[1;32m�[0m in �[0;36mplayGame�[1;34m(observe)�[0m
�[0;32m 6�[0m �[0mmodel�[0m �[1;33m=�[0m �[0mbuildmodel�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[0;32m 7�[0m �[1;32mtry�[0m�[1;33m:�[0m�[1;33m�[0m�[0m
�[1;32m----> 8�[1;33m �[0mtrainNetwork�[0m�[1;33m(�[0m�[0mmodel�[0m�[1;33m,�[0m�[0mgame_state�[0m�[1;33m,�[0m�[0mobserve�[0m�[1;33m=�[0m�[0mobserve�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[0m�[0;32m 9�[0m �[1;32mexcept�[0m �[0mStopIteration�[0m�[1;33m:�[0m�[1;33m�[0m�[0m
�[0;32m 10�[0m �[0mgame�[0m�[1;33m.�[0m�[0mend�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[1;32m�[0m in �[0;36mtrainNetwork�[1;34m(model, game_state, observe)�[0m
�[0;32m 9�[0m �[0mlast_time�[0m �[1;33m=�[0m �[0mtime�[0m�[1;33m.�[0m�[0mtime�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[0;32m 10�[0m �[1;31m# store the previous observations in replay memory�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m---> 11�[1;33m �[0mD�[0m �[1;33m=�[0m �[0mload_obj�[0m�[1;33m(�[0m�[1;34m"D"�[0m�[1;33m)�[0m �[1;31m#load from file system�[0m�[1;33m�[0m�[0m
�[0m�[0;32m 12�[0m �[1;31m# get the first state by doing nothing�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0;32m 13�[0m �[0mdo_nothing�[0m �[1;33m=�[0m �[0mnp�[0m�[1;33m.�[0m�[0mzeros�[0m�[1;33m(�[0m�[0mACTIONS�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[1;32m�[0m in �[0;36mload_obj�[1;34m(name)�[0m
�[0;32m 3�[0m �[0mpickle�[0m�[1;33m.�[0m�[0mdump�[0m�[1;33m(�[0m�[0mobj�[0m�[1;33m,�[0m �[0mf�[0m�[1;33m,�[0m �[0mpickle�[0m�[1;33m.�[0m�[0mHIGHEST_PROTOCOL�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[0;32m 4�[0m �[1;32mdef�[0m �[0mload_obj�[0m�[1;33m(�[0m�[0mname�[0m �[1;33m)�[0m�[1;33m:�[0m�[1;33m�[0m�[0m
�[1;32m----> 5�[1;33m �[1;32mwith�[0m �[0mopen�[0m�[1;33m(�[0m�[1;34m'objects/'�[0m �[1;33m+�[0m �[0mname�[0m �[1;33m+�[0m �[1;34m'.pkl'�[0m�[1;33m,�[0m �[1;34m'rb'�[0m�[1;33m)�[0m �[1;32mas�[0m �[0mf�[0m�[1;33m:�[0m�[1;33m�[0m�[0m
�[0m�[0;32m 6�[0m �[1;32mreturn�[0m �[0mpickle�[0m�[1;33m.�[0m�[0mload�[0m�[1;33m(�[0m�[0mf�[0m�[1;33m)�[0m�[1;33m�[0m�[0m
�[0;32m 7�[0m �[1;33m�[0m�[0m
�[1;31mFileNotFoundError�[0m: [Errno 2] No such file or directory: 'objects/D.pkl'
FileNotFoundError: [Errno 2] No such file or directory: 'objects/D.pkl'`
Hi, While trying to open 'chrome://dino' url in selenium, it is throwing the following error:
WebDriverException Traceback (most recent call last)
in
----> 1 driver.get("chrome://dino/")
F:\Anaconda\envs\opencv\lib\site-packages\selenium\webdriver\remote\webdriver.py in get(self, url)
331 Loads a web page in the current browser session.
332 """
--> 333 self.execute(Command.GET, {'url': url})
334
335 @Property
F:\Anaconda\envs\opencv\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
319 response = self.command_executor.execute(driver_command, params)
320 if response:
--> 321 self.error_handler.check_response(response)
322 response['value'] = self._unwrap_value(
323 response.get('value', None))
F:\Anaconda\envs\opencv\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):
WebDriverException: Message: unknown error: net::ERR_INTERNET_DISCONNECTED
i tried googling for a solution but, couldn't find any that fixed the issue.
Kindly help me resolve this.
I set up the ML-in-a-Box, machine on Paperspace.
Unfortunately when I run init_cache() get the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'objects/epsilon.pkl
Hi! I was looking through the code, and I realized that there's no way for the dino to duck during the game. There's a duck method for the DinoAgent class, but there's nothing in the Game class to support it.
I added in the functionality, and I was wondering if I could make a pull request.
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.