rlworkgroup / garage

A toolkit for reproducible reinforcement learning research.
MIT License
1.84k stars 309 forks source link

Import error while using examples jupyter notebook custom_env.ipynb #2283

Open Kamyab-Majid opened 3 years ago

Kamyab-Majid commented 3 years ago

ImportError: cannot import name 'TFTrainer' from 'garage.experiment' (/content/garage/src/garage/experiment/init.py)

avnishn commented 3 years ago

Hi @MKamyab1991,

Can you provide more details about your installation? Did you pip install, or are you building from source? What version, or commit of garage are you using?

Kamyab-Majid commented 3 years ago

Thanks for the response. I used the pip and the garage version is garage-2021.3.0 this is the full error :

ImportError Traceback (most recent call last)

in 11 12 ---> 13 from garage.experiment import TFTrainer 14 from garage.experiment.deterministic import set_seed 15 from dowel import logger, StdOutput ImportError: cannot import name 'TFTrainer' from 'garage.experiment' (/home/adrian/anaconda3/envs/attitude/lib/python3.8/site-packages/garage/experiment/__init__.py)
Rm4n commented 3 years ago

I have the exact same problem. I tried installing using pip and building from source and both ran to the above error.

Kamyab-Majid commented 3 years ago

I have the exact same problem. I tried installing using pip and building from source and both ran to the above error. Just copy the package in your project or fix it manually. I think they are busy with other issues :).

avnishn commented 3 years ago

Just looked into this.

We moved TFTrainer to the base of garage, so you can now import it by calling from garage import TFTrainer

Sorry for the slow replies. At the moment many of our students are on summer vacation, and so only there will only be 2 active maintainers till mid August.

@MKamyab1991 could you go ahead and try this fix out? If it works for you, could you please open a PR?

Thanks, @Avnishn

Rm4n commented 3 years ago

I used the examples in the garage documentation and as it looks like they're not updated cause TFtrainer is no longer under experiment module and has moved to trainer module. The examples in the git are updated though.