Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weijiafeng opened this issue Jun 2, 2019 · 14 comments

Comments

@weijiafeng
Copy link

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

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

image

  1. 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
Copy link
Owner

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
Copy link
Author

@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
Copy link
Owner

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

@weijiafeng
Copy link
Author

@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
Copy link
Author

@avisingh599
image

@avisingh599
Copy link
Owner

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
Copy link
Author

@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
Copy link
Author

@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
Copy link
Owner

avisingh599 commented Jun 3, 2019

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
Copy link
Author

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

image

@avisingh599
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants