SuperMarioBros-Nes with OpenAI baseline, How?How to merge two dictionaries in a single expression?How do I check if a list is empty?How do I check whether a file exists without exceptions?How can I safely create a nested directory in Python?How can I make a time delay in Python?How do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I list all files of a directory?Creating an atari-like game in OpenAI gym

Correct way of drawing empty, half-filled and fully filled circles?

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

Is disk brake effectiveness mitigated by tyres losing traction under strong braking?

Handling Null values (and equivalents) routinely in Python

Can there be a single technologically advanced nation, in a continent full of non-technologically advanced nations?

Kanji etymology of 毎?

Why do people keep telling me that I am a bad photographer?

Where are the "shires" in the UK?

Dangerous workplace travelling

Mug and wireframe entirely disappeared

Is there an age requirement to play in Adventurers League?

Any examples of liquids volatile at room temp but non-flammable?

Are there terms in German for different skull shapes?

Would you use "llamarse" for an animal's name?

How to deal with employer who keeps me at work after working hours

Has a commercial or military jet bi-plane ever been manufactured?

GitLab account hacked and repo wiped

Are pressure-treated posts that have been submerged for a few days ruined?

Hostile Divisor Numbers

Why would a military not separate its forces into different branches?

Why did the Apollo 13 crew extend the LM landing gear?

Why do these characters still seem to be the same age after the events of Endgame?

Why does sound not move through a wall?

Voltage Balun 1:1



SuperMarioBros-Nes with OpenAI baseline, How?


How to merge two dictionaries in a single expression?How do I check if a list is empty?How do I check whether a file exists without exceptions?How can I safely create a nested directory in Python?How can I make a time delay in Python?How do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I list all files of a directory?Creating an atari-like game in OpenAI gym






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to run SuperMarioBros environment in OpenAI baselines. Usually these retro environments are different from native attari 2600 that been support by gym library.



In order to make it run with baselines a third party library is need to be installed that comes with retro using the code taking the help from this link (https://www.videogames.ai/2019/01/29/Setup-OpenAI-baselines-retro.html)



python -m retro.import .
python -m baselines.run --alg=a2c --env=SuperMarioBros-Nes --gamestate=Level3-1.state --network=cnn --num_env=2 --num_timesteps=1e3


but unfortunately even after this, it doesn't run and giving the error of rom not found.



Although after installing the external retro, it should be okay but its requiring raw-rom files directly from game-emulator. Is there any possible way to find a turn around ? Or am I missing something here



 Process SpawnProcess-2: Traceback (most recent call last): 
File "/usr/local/lib/python3.6/dist-packages/retro/__init__.py", line 49, in make retro.data.get_romfile_path(game, inttype)
File "/usr/local/lib/python3.6/dist-packages/retro/data/__init__.py", line 288, in get_romfile_path
raise FileNotFoundError("No romfiles found for game: %s" % game) FileNotFoundError:
No romfiles found for game: SuperMarioBros-Nes









share|improve this question






























    1















    I am trying to run SuperMarioBros environment in OpenAI baselines. Usually these retro environments are different from native attari 2600 that been support by gym library.



    In order to make it run with baselines a third party library is need to be installed that comes with retro using the code taking the help from this link (https://www.videogames.ai/2019/01/29/Setup-OpenAI-baselines-retro.html)



    python -m retro.import .
    python -m baselines.run --alg=a2c --env=SuperMarioBros-Nes --gamestate=Level3-1.state --network=cnn --num_env=2 --num_timesteps=1e3


    but unfortunately even after this, it doesn't run and giving the error of rom not found.



    Although after installing the external retro, it should be okay but its requiring raw-rom files directly from game-emulator. Is there any possible way to find a turn around ? Or am I missing something here



     Process SpawnProcess-2: Traceback (most recent call last): 
    File "/usr/local/lib/python3.6/dist-packages/retro/__init__.py", line 49, in make retro.data.get_romfile_path(game, inttype)
    File "/usr/local/lib/python3.6/dist-packages/retro/data/__init__.py", line 288, in get_romfile_path
    raise FileNotFoundError("No romfiles found for game: %s" % game) FileNotFoundError:
    No romfiles found for game: SuperMarioBros-Nes









    share|improve this question


























      1












      1








      1


      0






      I am trying to run SuperMarioBros environment in OpenAI baselines. Usually these retro environments are different from native attari 2600 that been support by gym library.



      In order to make it run with baselines a third party library is need to be installed that comes with retro using the code taking the help from this link (https://www.videogames.ai/2019/01/29/Setup-OpenAI-baselines-retro.html)



      python -m retro.import .
      python -m baselines.run --alg=a2c --env=SuperMarioBros-Nes --gamestate=Level3-1.state --network=cnn --num_env=2 --num_timesteps=1e3


      but unfortunately even after this, it doesn't run and giving the error of rom not found.



      Although after installing the external retro, it should be okay but its requiring raw-rom files directly from game-emulator. Is there any possible way to find a turn around ? Or am I missing something here



       Process SpawnProcess-2: Traceback (most recent call last): 
      File "/usr/local/lib/python3.6/dist-packages/retro/__init__.py", line 49, in make retro.data.get_romfile_path(game, inttype)
      File "/usr/local/lib/python3.6/dist-packages/retro/data/__init__.py", line 288, in get_romfile_path
      raise FileNotFoundError("No romfiles found for game: %s" % game) FileNotFoundError:
      No romfiles found for game: SuperMarioBros-Nes









      share|improve this question
















      I am trying to run SuperMarioBros environment in OpenAI baselines. Usually these retro environments are different from native attari 2600 that been support by gym library.



      In order to make it run with baselines a third party library is need to be installed that comes with retro using the code taking the help from this link (https://www.videogames.ai/2019/01/29/Setup-OpenAI-baselines-retro.html)



      python -m retro.import .
      python -m baselines.run --alg=a2c --env=SuperMarioBros-Nes --gamestate=Level3-1.state --network=cnn --num_env=2 --num_timesteps=1e3


      but unfortunately even after this, it doesn't run and giving the error of rom not found.



      Although after installing the external retro, it should be okay but its requiring raw-rom files directly from game-emulator. Is there any possible way to find a turn around ? Or am I missing something here



       Process SpawnProcess-2: Traceback (most recent call last): 
      File "/usr/local/lib/python3.6/dist-packages/retro/__init__.py", line 49, in make retro.data.get_romfile_path(game, inttype)
      File "/usr/local/lib/python3.6/dist-packages/retro/data/__init__.py", line 288, in get_romfile_path
      raise FileNotFoundError("No romfiles found for game: %s" % game) FileNotFoundError:
      No romfiles found for game: SuperMarioBros-Nes






      python openai-gym






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 10:42









      desertnaut

      21.5k84681




      21.5k84681










      asked Mar 23 at 0:44









      Zafar MahmoodZafar Mahmood

      161




      161






















          2 Answers
          2






          active

          oldest

          votes


















          0














          By default only 1 game ROM is installed by retro.



          Did you try this. It is not using retro env (Or maybe using internally, not sure). But it is working for me:
          https://pypi.org/project/gym-super-mario-bros/



          Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
          [GCC 7.3.0] on linux2
          Type "help", "copyright", "credits" or "license" for more information.
          >>> from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
          >>> import gym_super_mario_bros
          >>> from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
          >>> env = gym_super_mario_bros.make('SuperMarioBros-v0')
          >>> env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)
          >>> done = True
          >>> for step in range(5000):
          ... if done:
          ... state = env.reset()
          ... state, reward, done, info = env.step(env.action_space.sample())
          ... env.render()
          ...


          Note: I am running on linux machine (Windows was giving trouble)






          share|improve this answer






























            0














            I did a hack and able to run the mario in retro (In windows itself). Below are step by step of the trick:



            1. install retro and install
              https://pypi.org/project/gym-super-mario-bros/ given in my previous
              answer

            2. Copy .nes files from
              lib/python3.7/site-packages/gym_super_mario_bros/_roms (this is
              where gym-super-mario-bros installed in site-packages) -> to
              Libsite-packagesretrodatastableSuperMarioBros-Nes (This is
              where retro is installed in site-packages).

            3. Rename the
              super-mario-bros.nes to rom.nes

            4. You are done. You can start mario using following code :


            import retro
            def main():
            env = retro.make(game='SuperMarioBros-Nes')
            obs = env.reset()
            while True:
            obs, rew, done, info = env.step(env.action_space.sample())
            env.render()
            if done:
            obs = env.reset()
            env.close()

            if __name__ == "__main__":
            main()



            An extra tip: If you want to play mario manually after this then run following command. (Z for jump and x for firing): python -m retro.examples.interactive --game SuperMarioBros-Nes [Enjoy]






            share|improve this answer

























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309518%2fsupermariobros-nes-with-openai-baseline-how%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              By default only 1 game ROM is installed by retro.



              Did you try this. It is not using retro env (Or maybe using internally, not sure). But it is working for me:
              https://pypi.org/project/gym-super-mario-bros/



              Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
              [GCC 7.3.0] on linux2
              Type "help", "copyright", "credits" or "license" for more information.
              >>> from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
              >>> import gym_super_mario_bros
              >>> from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
              >>> env = gym_super_mario_bros.make('SuperMarioBros-v0')
              >>> env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)
              >>> done = True
              >>> for step in range(5000):
              ... if done:
              ... state = env.reset()
              ... state, reward, done, info = env.step(env.action_space.sample())
              ... env.render()
              ...


              Note: I am running on linux machine (Windows was giving trouble)






              share|improve this answer



























                0














                By default only 1 game ROM is installed by retro.



                Did you try this. It is not using retro env (Or maybe using internally, not sure). But it is working for me:
                https://pypi.org/project/gym-super-mario-bros/



                Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
                [GCC 7.3.0] on linux2
                Type "help", "copyright", "credits" or "license" for more information.
                >>> from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
                >>> import gym_super_mario_bros
                >>> from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
                >>> env = gym_super_mario_bros.make('SuperMarioBros-v0')
                >>> env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)
                >>> done = True
                >>> for step in range(5000):
                ... if done:
                ... state = env.reset()
                ... state, reward, done, info = env.step(env.action_space.sample())
                ... env.render()
                ...


                Note: I am running on linux machine (Windows was giving trouble)






                share|improve this answer

























                  0












                  0








                  0







                  By default only 1 game ROM is installed by retro.



                  Did you try this. It is not using retro env (Or maybe using internally, not sure). But it is working for me:
                  https://pypi.org/project/gym-super-mario-bros/



                  Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
                  [GCC 7.3.0] on linux2
                  Type "help", "copyright", "credits" or "license" for more information.
                  >>> from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
                  >>> import gym_super_mario_bros
                  >>> from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
                  >>> env = gym_super_mario_bros.make('SuperMarioBros-v0')
                  >>> env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)
                  >>> done = True
                  >>> for step in range(5000):
                  ... if done:
                  ... state = env.reset()
                  ... state, reward, done, info = env.step(env.action_space.sample())
                  ... env.render()
                  ...


                  Note: I am running on linux machine (Windows was giving trouble)






                  share|improve this answer













                  By default only 1 game ROM is installed by retro.



                  Did you try this. It is not using retro env (Or maybe using internally, not sure). But it is working for me:
                  https://pypi.org/project/gym-super-mario-bros/



                  Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
                  [GCC 7.3.0] on linux2
                  Type "help", "copyright", "credits" or "license" for more information.
                  >>> from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
                  >>> import gym_super_mario_bros
                  >>> from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
                  >>> env = gym_super_mario_bros.make('SuperMarioBros-v0')
                  >>> env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)
                  >>> done = True
                  >>> for step in range(5000):
                  ... if done:
                  ... state = env.reset()
                  ... state, reward, done, info = env.step(env.action_space.sample())
                  ... env.render()
                  ...


                  Note: I am running on linux machine (Windows was giving trouble)







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 23 at 15:34









                  Sandeep BSandeep B

                  87




                  87























                      0














                      I did a hack and able to run the mario in retro (In windows itself). Below are step by step of the trick:



                      1. install retro and install
                        https://pypi.org/project/gym-super-mario-bros/ given in my previous
                        answer

                      2. Copy .nes files from
                        lib/python3.7/site-packages/gym_super_mario_bros/_roms (this is
                        where gym-super-mario-bros installed in site-packages) -> to
                        Libsite-packagesretrodatastableSuperMarioBros-Nes (This is
                        where retro is installed in site-packages).

                      3. Rename the
                        super-mario-bros.nes to rom.nes

                      4. You are done. You can start mario using following code :


                      import retro
                      def main():
                      env = retro.make(game='SuperMarioBros-Nes')
                      obs = env.reset()
                      while True:
                      obs, rew, done, info = env.step(env.action_space.sample())
                      env.render()
                      if done:
                      obs = env.reset()
                      env.close()

                      if __name__ == "__main__":
                      main()



                      An extra tip: If you want to play mario manually after this then run following command. (Z for jump and x for firing): python -m retro.examples.interactive --game SuperMarioBros-Nes [Enjoy]






                      share|improve this answer





























                        0














                        I did a hack and able to run the mario in retro (In windows itself). Below are step by step of the trick:



                        1. install retro and install
                          https://pypi.org/project/gym-super-mario-bros/ given in my previous
                          answer

                        2. Copy .nes files from
                          lib/python3.7/site-packages/gym_super_mario_bros/_roms (this is
                          where gym-super-mario-bros installed in site-packages) -> to
                          Libsite-packagesretrodatastableSuperMarioBros-Nes (This is
                          where retro is installed in site-packages).

                        3. Rename the
                          super-mario-bros.nes to rom.nes

                        4. You are done. You can start mario using following code :


                        import retro
                        def main():
                        env = retro.make(game='SuperMarioBros-Nes')
                        obs = env.reset()
                        while True:
                        obs, rew, done, info = env.step(env.action_space.sample())
                        env.render()
                        if done:
                        obs = env.reset()
                        env.close()

                        if __name__ == "__main__":
                        main()



                        An extra tip: If you want to play mario manually after this then run following command. (Z for jump and x for firing): python -m retro.examples.interactive --game SuperMarioBros-Nes [Enjoy]






                        share|improve this answer



























                          0












                          0








                          0







                          I did a hack and able to run the mario in retro (In windows itself). Below are step by step of the trick:



                          1. install retro and install
                            https://pypi.org/project/gym-super-mario-bros/ given in my previous
                            answer

                          2. Copy .nes files from
                            lib/python3.7/site-packages/gym_super_mario_bros/_roms (this is
                            where gym-super-mario-bros installed in site-packages) -> to
                            Libsite-packagesretrodatastableSuperMarioBros-Nes (This is
                            where retro is installed in site-packages).

                          3. Rename the
                            super-mario-bros.nes to rom.nes

                          4. You are done. You can start mario using following code :


                          import retro
                          def main():
                          env = retro.make(game='SuperMarioBros-Nes')
                          obs = env.reset()
                          while True:
                          obs, rew, done, info = env.step(env.action_space.sample())
                          env.render()
                          if done:
                          obs = env.reset()
                          env.close()

                          if __name__ == "__main__":
                          main()



                          An extra tip: If you want to play mario manually after this then run following command. (Z for jump and x for firing): python -m retro.examples.interactive --game SuperMarioBros-Nes [Enjoy]






                          share|improve this answer















                          I did a hack and able to run the mario in retro (In windows itself). Below are step by step of the trick:



                          1. install retro and install
                            https://pypi.org/project/gym-super-mario-bros/ given in my previous
                            answer

                          2. Copy .nes files from
                            lib/python3.7/site-packages/gym_super_mario_bros/_roms (this is
                            where gym-super-mario-bros installed in site-packages) -> to
                            Libsite-packagesretrodatastableSuperMarioBros-Nes (This is
                            where retro is installed in site-packages).

                          3. Rename the
                            super-mario-bros.nes to rom.nes

                          4. You are done. You can start mario using following code :


                          import retro
                          def main():
                          env = retro.make(game='SuperMarioBros-Nes')
                          obs = env.reset()
                          while True:
                          obs, rew, done, info = env.step(env.action_space.sample())
                          env.render()
                          if done:
                          obs = env.reset()
                          env.close()

                          if __name__ == "__main__":
                          main()



                          An extra tip: If you want to play mario manually after this then run following command. (Z for jump and x for firing): python -m retro.examples.interactive --game SuperMarioBros-Nes [Enjoy]







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 23 at 17:14

























                          answered Mar 23 at 16:44









                          Sandeep BSandeep B

                          87




                          87



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309518%2fsupermariobros-nes-with-openai-baseline-how%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript