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

Errors of patch #2

Open
DeepakIngole opened this issue Jan 27, 2021 · 2 comments
Open

Errors of patch #2

DeepakIngole opened this issue Jan 27, 2021 · 2 comments

Comments

@DeepakIngole
Copy link

I am trying to run your codes on macOS BigSur 11.1 with PyChram 2020.3. While running main.py I'm getting the following errors. Would you please help me to resolve the errors? Which versions of the gym, TensorFlow python, etc. I will need? Thanks.

Failed to patch CartPoleEnv.__init__Traceback (most recent call last):
File "/Users/xxxx/Documents/Python_Deepak/cartpole-control-master/main.py", line 6, in
from cpc.env import CartPoleEnv, AdvancedCartPoleEnv
File "/Users/xxxx/Documents/Python_Deepak/cartpole-control-master/cpc/init.py", line 94, in
CartPoleEnv.init = dirty_patch(CartPoleEnv.init)
File "/Users/xxxx/Documents/Python_Deepak/cartpole-control-master/cpc/init.py", line 52, in dirty_patch
idx_call = payload.index(ins)
ValueError: subsection not found

@NaleRaphael
Copy link
Owner

Hi @DeepakIngole, that error message seems not related to the version of gym or TensorFlow, I may need further details to investigate the issue. But I also just add a requirement.txt to the latest commit, you can try to pull the latest version of this repo and use the following command to install dependencies:

$ pip install -r ./requirements.txt

But note that it's recommended to install them in a new virtual environment to avoid those old dependencies messing your environment up since this repository was built about 2 years ago, and I don't have too much free time to keep it updated.

Besides, I was running experiments on a CPU-only environment before. So that there might be some issues related to CUDA libraries if you want to run it with tensorflow-gpu, and you might need to solve them on your own. I'm sorry about it.

But if you have any further questions, please feel free to let me know.

@NaleRaphael
Copy link
Owner

By the way, if you want to run this repository with tensorflow>=2 and newer version of openai-gym, you can remove code related to dirty patch in cpc/__init__,py. That dirty patch was just made for openai-gym==1.10, so it might not work in newer versions.

But It might take you some time to solve errors resulted by different versions of libraries since there would be some deprecated/removed APIs, just make sure you have enough free time before doing it.

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

2 participants