LanqingLi1993 / FOCAL-ICLR

Code for FOCAL Paper Published at ICLR 2021
MIT License
49 stars 9 forks source link

Gym homonym conflict issue #11

Open Folly135 opened 1 year ago

Folly135 commented 1 year ago

Hello, I have some further questions about gym that I think are crucial to running this code correctly. I feel that logically, the system should first search the gym directory under rand_param_envs for contents, and only use the gym directory installed in the python environment when not found, however after installing requirements.txt and running export PYTHONPATH=./rand_param_envs:$PYTHONPATH as per the readme, the gym folder completely overrides the gym in the python environment. This causes calls to always be made in the folder, and when a function is not found in the folder, it gives an error instead of searching the python environment to see if the corresponding function exists there.

I cannot understand or resolve this name conflict issue, and I'm wondering if you have encountered this problem before and how you solved it. Would you be able to provide any insight or advice to solve this gym folder vs gym library conflict?

I hope to receive your reply. Best wishes to you!

LanqingLi1993 commented 1 year ago

@Folly135

The purpose of using submodule rand_param_envs is essentially, to run experiments on task distributions where different tasks correspond to different model parameters (Walker and Hopper). You can checkout the definition of the Walker and Hopper envs at ./rand_param_envs/walker2d_rand_params.py and ./rand_param_envs/hopper_rand_params.py, respectively.

To resolve name conflict, I think the easiest way is to rename the gym module at ./rand_param_envs/gym and change all dependencies accordingly, such as the imports in ./rand_param_envs/walker2d_rand_params.py and ./rand_param_envs/base.py.

Please let me know if this works for you!