Paperspace / DinoRunTutorial

Accompanying code for Paperspace tutorial "Build an AI to play Dino Run"
https://blog.paperspace.com/dino-run
MIT License
323 stars 104 forks source link

Selenium and dino game #12

Open Tejas-Haritsa-vk opened 3 years ago

Tejas-Haritsa-vk commented 3 years ago

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.
tfppcn commented 3 years ago

I have the same problem as Tejas-Haritsa-vk. Have you solved the problem?

Tejas-Haritsa-vk commented 3 years ago

I have the same problem as Tejas-Haritsa-vk. Have you solved the problem?

Hi, tfppcn. I have resolved this issue by using the folloing lines of code:

from selenium.common.exceptions import WebDriverException

try: driver.get(game_url) except WebDriverException: pass

tfppcn commented 3 years ago

Thank you Tejas, I've finally got it to work with your help. It runs very slowly on my laptop without GPU but at least it runs. What is the highest score you got? Is it possible to copy a trained model.h5 and use it to speed up the learning?

Tejas-Haritsa-vk commented 3 years ago

Thank you Tejas, I've finally got it to work with your help. It runs very slowly on my laptop without GPU but at least it runs. What is the highest score you got? Is it possible to copy a trained model.h5 and use it to speed up the learning?

you are welcome @tfppcn, yes it is possible to speed up training using a pre trained model. I haven't trained it for long yet hence no score, the only 2 time I ran it scored around 140-160.

ravi72munde commented 3 years ago

Thank you Tejas, I've finally got it to work with your help. It runs very slowly on my laptop without GPU but at least it runs. What is the highest score you got? Is it possible to copy a trained model.h5 and use it to speed up the learning?

Hi @Tejas-Haritsa-vk , do you happen to know the root cause of the issue?

tfppcn commented 3 years ago

I’m not sure but looking at the error messages, I guess that selenium is not happy about the web browser being offline. Tejas’s solution of error handling that with an exception worked. Perhaps selenium has been updated since the last time you ran it.


From: Ravi Munde notifications@github.com Sent: Thursday, December 10, 2020 5:33:39 AM To: Paperspace/DinoRunTutorial DinoRunTutorial@noreply.github.com Cc: tfppcn tfpp_cn@outlook.com; Mention mention@noreply.github.com Subject: Re: [Paperspace/DinoRunTutorial] Selenium and dino game (#12)

Thank you Tejas, I've finally got it to work with your help. It runs very slowly on my laptop without GPU but at least it runs. What is the highest score you got? Is it possible to copy a trained model.h5 and use it to speed up the learning?

Hi @tfppcnhttps://github.com/tfppcn , do you happen to know the root cause of the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Paperspace/DinoRunTutorial/issues/12#issuecomment-741966414, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANTSTCUG7ZWXAJUPHV3N4J3ST67IHANCNFSM4TCOSZOQ.

Tejas-Haritsa-vk commented 3 years ago

Hi,

I don't think it is due to selenium update at all as I tried the same selenium package on two different systems and one worked and the other didn't. So, I think it is more connected towards the particular system firewall and security settings maybe. Not 100% sure though, as I checked my firewall and it was allowing python. Hope this helps.

On Thu, Dec 10, 2020, 8:09 AM tfppcn notifications@github.com wrote:

I’m not sure but looking at the error messages, I guess that selenium is not happy about the web browser being offline. Tejas’s solution of error handling that with an exception worked. Perhaps selenium has been updated since the last time you ran it.


From: Ravi Munde notifications@github.com Sent: Thursday, December 10, 2020 5:33:39 AM To: Paperspace/DinoRunTutorial DinoRunTutorial@noreply.github.com Cc: tfppcn tfpp_cn@outlook.com; Mention mention@noreply.github.com Subject: Re: [Paperspace/DinoRunTutorial] Selenium and dino game (#12)

Thank you Tejas, I've finally got it to work with your help. It runs very slowly on my laptop without GPU but at least it runs. What is the highest score you got? Is it possible to copy a trained model.h5 and use it to speed up the learning?

Hi @tfppcnhttps://github.com/tfppcn , do you happen to know the root cause of the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub< https://github.com/Paperspace/DinoRunTutorial/issues/12#issuecomment-741966414>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ANTSTCUG7ZWXAJUPHV3N4J3ST67IHANCNFSM4TCOSZOQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Paperspace/DinoRunTutorial/issues/12#issuecomment-742197317, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSTLU347VGX2QXP7ZPLPZLSUAYFXANCNFSM4TCOSZOQ .

nicosquare commented 2 years ago

I have the same problem as Tejas-Haritsa-vk. Have you solved the problem?

Hi, tfppcn. I have resolved this issue by using the folloing lines of code:

from selenium.common.exceptions import WebDriverException

try: driver.get(game_url) except WebDriverException: pass

I confirm that this tweak helped me to run the project.

Thanks!

BlaineOmega commented 2 years ago

The suggestion by @Tejas-Haritsa-vk worked for me to get the project running. I am not able to get the program to jump after the observation period. And advice anyone?