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

Installation issue #13

Closed
HareshKarnan opened this issue Nov 10, 2018 · 13 comments · Fixed by #53
Closed

Installation issue #13

HareshKarnan opened this issue Nov 10, 2018 · 13 comments · Fixed by #53

Comments

@HareshKarnan
Copy link

I get a weird error when i test my installation using

python -m spinup.run ppo --hid [32,32] --env Walker2d-v2 --exp_name installtest

Error :

`================================================================================
ExperimentGrid [installtest] runs over parameters:

env_name [env]

Walker2d-v2

ac_kwargs:hidden_sizes [ac-hid]

[32, 32]

Variants, counting seeds: 1
Variants, not counting seeds: 1

================================================================================

Preparing to run the following experiments...

installtest

================================================================================

Launch delayed to give you a few seconds to review your experiments.

To customize or disable this behavior, change WAIT_BEFORE_LAUNCH in
spinup/user_config.py.

================================================================================
Running experiment:

installtest

with kwargs:

{
"ac_kwargs": {
"hidden_sizes": [
32,
32
]
},
"env_name": "Walker2d-v2",
"seed": 0
}

Traceback (most recent call last):
File "/Users/haresh/Documents/spinningup/spinup/utils/run_entrypoint.py", line 10, in
thunk = pickle.loads(zlib.decompress(base64.b64decode(args.encoded_thunk)))
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1388, in loads
return Unpickler(file).load()
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 864, in load
dispatchkey
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 892, in load_proto
raise ValueError, "unsupported pickle protocol: %d" % proto
ValueError: unsupported pickle protocol: 4

================================================================================

There appears to have been an error in your experiment.

Check the traceback above to see what actually went wrong. The
traceback below, included for completeness (but probably not useful
for diagnosing the error), shows the stack leading up to the
experiment launch.

================================================================================

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/haresh/Documents/spinningup/spinup/run.py", line 230, in
parse_and_execute_grid_search(cmd, args)
File "/Users/haresh/Documents/spinningup/spinup/run.py", line 162, in parse_and_execute_grid_search
eg.run(algo, **run_kwargs)
File "/Users/haresh/Documents/spinningup/spinup/utils/run_utils.py", line 546, in run
data_dir=data_dir, datestamp=datestamp, **var)
File "/Users/haresh/Documents/spinningup/spinup/utils/run_utils.py", line 171, in call_experiment
subprocess.check_call(cmd, env=os.environ)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', '/Users/haresh/Documents/spinningup/spinup/utils/run_entrypoint.py', 'eJyNUs9P1EAUnm6XpYCgEaORE4mX5eAuIfG2cnCNlyYcUOPJTIbOdDt2OlM7MygmJCYILMnEC08v/rO+7iLgjU46fe97/d7v791fZzGZPeFJpozntcxKJQa3ZAhrNJdK0dzrzEmj4RL6BQn3acVKQW0p5iaEEV2lB14qJzV1R7VALCRjw8W7VjmFfeinZHbidH38hkfTTtlrtnmHE0UuUOPRU3JBzsl5lHd4zLs/EsQWRqS1vCQumsYnUUSm3RyRnyhx8pZAfy8kQh9SzSoBKSmW/gXpYJDlafSJTMlJhD/unULotlljKlthNHxvRWOHBWuELYavTeYroZ0d2lpqLfXE1zMRP95JZYeN13QmDeojrGukWHXA2S6kf8YEipUQT44qOIMth3WGFxnDnomvtWhk63YwUgYhuztwhdclrZW3N9i1r9BrK8k1OCjWQ1LVkuamKVu3xYOwfMOF9Pd4jXSSqD0Po16cxEguv7BmYiEsal/RrPYQFmYUOMcEi/UzaHNL42PU9+EY+mFxoswBpoBKsREez+sdzKtsgztj0FhsXIINCRc588pZ2AtdLjOHpNCrDPftlvzPve4Vrg8uk/WNoIdMeWHhI/QxMvZr5QNTpWh2+PPDHQhLLKNX6aPbe4XkXGhq5bc5Jd1MN4UNXSsExyGHVWUmE9HcUPph2XhXe0e5bCC8usN0OXNsKLV1OConrLstU7uNM8b5zdcqrNyygfdpFB5dFczUxOBK1KZ9IcTtfQkiJJ89U3PyszssA3i3P/gLgUhOrw==']' returned non-zero exit status 1.`

@jachiam
Copy link
Contributor

jachiam commented Nov 10, 2018

This is pretty weird---it looks like when the subprocess.check_call launches the run_entrypoint.py, instead of using Python 3.6 (which it should---and which you started with) it uses Python 2.7. I honestly find this pretty bizarre and don't entirely know how it could happen. Can you describe your system and setup?

@machinaut
Copy link

@HareshMiriyala what version of python (and python packages) are you using

@venkat-kittu
Copy link

I am also getting same error.
I am having both python 2.7 and python 3.6 installed on my ubuntu 18.04.
I have disabled python 2.7 by typing "alias python=python3" in ~/.bashrc then aslo it is not working?
Please can anyone solved this problem

@jachiam
Copy link
Contributor

jachiam commented Nov 10, 2018

@venkat-kittu: Looks like the answer to your problem is given in this Stack Overflow question. The alias with bashrc is insufficient---the executable with base name python needs to be Python 3.6.

@HareshMiriyala, do you have the same setup, where both Python versions are installed but you use an alias in the shell to get Python 3.6?

@HareshKarnan
Copy link
Author

Jachiam, yes, I do have both python2.7 and python3.6. I'm running OSX Mojave.

@jachiam
Copy link
Contributor

jachiam commented Nov 11, 2018

The "Change python version system-wide" section in the link provided by @justindixon appears to be the right solution. @HareshMiriyala, @venkat-kittu, try it and report back?

@saams4u
Copy link

saams4u commented Nov 11, 2018

@jachiam has the correct answer - tried it and it worked!

@jachiam
Copy link
Contributor

jachiam commented Nov 12, 2018

Based on @saams4u, I'm going to consider this closed for now, but @venkat-kittu or @HareshMiriyala, if the solution doesn't work for you, let me know and I'll reopen this.

@HareshKarnan
Copy link
Author

Hi all,
I tried setting alias='python3' . when i call python, it rightly opens python3. However, the problem still persists.

Running experiment:

walker

with kwargs:

{
"env_name": "Walker2d-v1",
"seed": 0
}

Traceback (most recent call last):
File "/Users/haresh/Documents/spinningup/spinup/utils/run_entrypoint.py", line 10, in
thunk = pickle.loads(zlib.decompress(base64.b64decode(args.encoded_thunk)))
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1388, in loads
return Unpickler(file).load()
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 864, in load
dispatchkey
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 892, in load_proto
raise ValueError, "unsupported pickle protocol: %d" % proto
ValueError: unsupported pickle protocol: 4

@HareshKarnan
Copy link
Author

Okay, so this fixed it :

Install anaconda 3.7 as it says here : https://spinningup.openai.com/en/latest/user/installation.html#id8

Then use conda install python=3.6 to downgrade it to use python3.6 (because there is some issue with installing tensorflow on python3.7). Then, try installing spinningup and things worked this time !

@jachiam
Copy link
Contributor

jachiam commented Nov 14, 2018

@HareshMiriyala Glad you got it figured out!

@karthikraja95
Copy link

karthikraja95 commented Nov 17, 2018

I am also getting this error. I checked my python version is 3.6.6.
I downloaded the python 3.7 version and downgraded using conda install python=3.6

@HareshMiriyala @jachiam can you tell me how you fixed those?

capture

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

Successfully merging a pull request may close this issue.

7 participants