Giter VIP home page Giter VIP logo

Comments (7)

lcswillems avatar lcswillems commented on May 26, 2024 1

I followed "exactly" what you did and I have no issue...

I write "exactly" between quotes because I replaced the "pip3" by "pip". I think that when you do "pip3", you install it for Python, not for your environment. This issue might come from this.

Let me know if it solves your problem.

Edit : And "python" instead of "python3"

from rl-starter-files.

lcswillems avatar lcswillems commented on May 26, 2024

Hi,
How did you install the package?
Did you do pip3 install -e torch_rl?

from rl-starter-files.

PabloAMC avatar PabloAMC commented on May 26, 2024

Hi,
Yes, I installed it that way. If I try running it again, I get that it uninstalls and reinstalls it.
Installing collected packages: torch-rl Found existing installation: torch-rl 1.0.0 Uninstalling torch-rl-1.0.0: Successfully uninstalled torch-rl-1.0.0 Running setup.py develop for torch-rl Successfully installed torch-rl

from rl-starter-files.

lcswillems avatar lcswillems commented on May 26, 2024

I can't reproduce your error...

I installed my package in a new environment and executed your command and I don't have any problem...

Did you modify some code in the repository?

from rl-starter-files.

PabloAMC avatar PabloAMC commented on May 26, 2024

I had not change anything. However, I've tried reinstalling "everything" from scratch. In particular, I've created a new environment
conda create -n spinningup python=3.7
Then

git clone https://github.com/openai/spinningup.git
cd spinningup
pip install -e .

Then I've installed the package inside spinningup directory

git clone https://github.com/lcswillems/torch-rl.git
cd torch-rl
pip3 install -e torch_rl

and inside torch_rl I've cloned and installed the Minigrid

git clone https://github.com/maximecb/gym-minigrid.git
cd gym-minigrid
pip3 install -e .

Finally, I've gone out of this last directory, so in the folder called torch-rl and executed
python3 -m scripts.train --algo ppo --env MiniGrid-DoorKey-5x5-v0 --model DoorKey
with the result you already know:

  File "/anaconda3/envs/spinningup/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/anaconda3/envs/spinningup/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/pablo/spinningup/torch-rl/scripts/train.py", line 17, in <module>
    from model import ACModel
  File "/Users/pablo/spinningup/torch-rl/model.py", line 17, in <module>
    class ACModel(nn.Module, torch_rl.RecurrentACModel):
AttributeError: module 'torch_rl' has no attribute 'RecurrentACModel'

I think it might have to do with the structure of directories... I'm unsure. However, if I am in a different directory and environment without the spinningup package, I get this:

Traceback (most recent call last):
  File "/anaconda3/envs/minigrid/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/anaconda3/envs/minigrid/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/pablo/torch-rl/scripts/train.py", line 4, in <module>
    import gym
ModuleNotFoundError: No module named 'gym'

from rl-starter-files.

PabloAMC avatar PabloAMC commented on May 26, 2024

I'm amazed. It was precisely that.
Many thanks!

from rl-starter-files.

lcswillems avatar lcswillems commented on May 26, 2024

Great!!
Good luck for your work :)

from rl-starter-files.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.