avisingh599 / reward-learning-rl

[RSS 2019] End-to-End Robotic Reinforcement Learning without Reward Engineering
https://sites.google.com/view/reward-learning-rl/
Other
366 stars 68 forks source link

dm_control+robosuite package not found, 'FeedforwardGaussianPolicy' object has no attribute '_Serializable__initialize' #8

Open weijiafeng opened 5 years ago

weijiafeng commented 5 years ago

Hi All, when running

softlearning run_example_local examples.classifier_rl \ --n_goal_examples 10 \ --task=Image48SawyerDoorPullHookEnv-v0 \ --algorithm VICERAQ \ --num-samples 5 \ --n_epochs 300 \ --active_query_frequency 10

I've experienced the following error:

  1. dm_control package not found. (The thing is - I've already ran pip install git+https://github.com/deepmind/dm_control.git and it is shown on terminal that I'd successfully install it:

    image
  2. robosuite package not found (same as above, I've already ran pip3 install robosuite:

    image
  3. AttributeError: 'FeedforwardGaussianPolicy' object has no attribute '_Serializable__initialize':

    image

FYI, my environment is: MacOS Mojave version 10.14.1 Python 3.6.5 Gym 0.9.3 Mujoco: 200 mujoco-py 1.50.1.68

Let me know what have I missed/done wrong? Thank you very much!

avisingh599 commented 5 years ago

Hi,

While I have not tried setting up this codebase on MacOS, I would recommend the following two things:

  1. Change mujoco version to 150 (instead of 200)
  2. Use v0.1 of the codebase: https://github.com/avisingh599/reward-learning-rl/tree/v0.1

I added the dm_control/robosuite dependencies later, and I think they have caused issues for others as well, and I will be investigating them soon. In the meanwhile, let me know if things work after you make the changes above.

weijiafeng commented 5 years ago

@avisingh599 Thanks for your response. I followed your instructions (I've put mjkey.txt and mjpro150 into ~/.mujoco folder, downloaded v0.1 and rebuilt the soft learning environment using the yml in this v0.1 folder), the three errors stated in the post above haven't come up, yet there's another error about the gym package saying that the module 'gym' has no attribute 'register':

image
avisingh599 commented 5 years ago

Hmm - this is a bit strange. Can you post the output of pip freeze | grep gym?

weijiafeng commented 5 years ago

@avisingh599 Is this because there's a file called gym.py which is messing up with the gym module installed? I am pretty sure I installed gym, in the same environment above, I checked my gym version: it is 0.9.3

image

Let me know if I've done anything incorrect? thanks!

weijiafeng commented 5 years ago

@avisingh599

image
avisingh599 commented 5 years ago

Hmm - your gym version from pip freeze seems correct, so I am not sure what exactly is happening. Could you try opening the python interpreter and typing in import gym; print(gym.__version__); gym.register()

weijiafeng commented 5 years ago

@avisingh599 To run what you said in python interpreter, for the Pycharm environment, I set it to the softlearning environment created as per your instructions in ReadMe. I am not sure what directory to set for the Conda Executable? Does this matter?

image
weijiafeng commented 5 years ago

@avisingh599 Or should I add the soft learning environment by ticking the "Existing Interpreter" and add it? how to specify the directory for the softlearning environment? like ..../bin/..... ?

avisingh599 commented 5 years ago

I'm actually not sure - as I haven't used this interface. I only work on Linux, and don't use pycharm. Having said that, your settings seem fine to me - so with whatever setting you were launching the softlearning commands, I would suggest just typing in python to open the interpreter in interactive mode, and try out the commands that I suggested above.

weijiafeng commented 5 years ago

@avisingh599 I've tried out your commands - the error of running gym.register() is "register() missing 1 required positional argument: 'id' :

image
avisingh599 commented 5 years ago

It looks like gym is able to find that function when you run it from this script, but it is somehow unable to find it from softlearning. I would suggest putting a break point (using IPython, for example) where softlearning errors out, investigating from there.

Skylark0924 commented 4 years ago

Well I just face the problem of 'AttributeError: 'FeedforwardGaussianPolicy' object has no attribute '_Serializable__initialize'', @avisingh599 . You might forget to answer this question. Could you give me some advice?

Skylark0924 commented 4 years ago

I tracked the codes and really did not find out where this attribute '_Serializable__initialize' is defined in gaussian_policy.py and base_policy.py.

Skylark0924 commented 4 years ago

Sorry to bother you. I found the solution. It's a problem caused by the wrong version of serializable package. Follow this issue to fix this bug.