mrahtz / learning-from-human-preferences

Reproduction of OpenAI and DeepMind's "Deep Reinforcement Learning from Human Preferences"
MIT License
301 stars 67 forks source link

Does not run on Windows #11

Closed jgocm closed 3 years ago

jgocm commented 3 years ago

Hi @mrahtz, I've been trying to run "run_test.py", but it gives me the following errors (the complete log is inside log.txt) file):

File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'start_parameter_server.<locals>.f'

File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

Also, when trying to run "utils_test.py" I get:

...EC:\Users\user\AppData\Local\Programs\Python\Python36\lib\unittest\case.py:633: ResourceWarning: unclosed <socket.socket fd=1792, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 60000)>
  outcome.errors.clear()
.
======================================================================
ERROR: test_get_port_range (__main__.TestUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:/Documents/2021/CIn/RL/Projeto/learning-from-human-preferences-origin/utils_test.py", line 44, in test_get_port_range
    ports = get_port_range(60000, 3)
  File "d:\Documents\2021\CIn\RL\Projeto\learning-from-human-preferences-origin\utils.py", line 178, in get_port_range
    raise e
  File "d:\Documents\2021\CIn\RL\Projeto\learning-from-human-preferences-origin\utils.py", line 171, in get_port_range
    s.bind(("127.0.0.1", port))
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted

----------------------------------------------------------------------
Ran 5 tests in 0.027s

FAILED (errors=1)

The other tests work fine.

I am using Python 3.6.8 (also tried 3.7.9 and did not work as well) and my Pip list is:

Package              Version
-------------------- ---------
absl-py              0.13.0
astor                0.8.1
atari-py             0.2.9
cached-property      1.5.2
certifi              2021.5.30
charset-normalizer   2.0.2
cloudpickle          1.6.0
cycler               0.10.0
dataclasses          0.8
easy-tf-log          1.1
gast                 0.2.2
google-pasta         0.2.0
grpcio               1.38.1
gym                  0.9.3
gym-moving-dot       2.0
h5py                 3.1.0
idna                 3.2
importlib-metadata   4.6.1
Keras-Applications   1.0.8
Keras-Preprocessing  1.1.2
kiwisolver           1.3.1
Markdown             3.3.4
matplotlib           3.3.4
memory-profiler      0.58.0
nose                 1.3.7
numpy                1.19.5
opt-einsum           3.3.0
Pillow               8.3.1
pip                  21.1.3
protobuf             3.17.3
psutil               5.8.0
pyglet               1.5.18
PyOpenGL             3.1.5
pyparsing            2.4.7
python-dateutil      2.8.2
requests             2.26.0
scipy                1.5.4
setuptools           57.1.0
six                  1.16.0
tensorboard          1.15.0
tensorflow           1.15.2
tensorflow-estimator 1.15.1
termcolor            1.1.0
typing-extensions    3.10.0.0
urllib3              1.26.6
Werkzeug             2.0.1
wheel                0.36.2
wrapt                1.12.1
zipp                 3.5.0

The environment was generated with the steps:

pipenv install
pipenv run pip install tensorflow==1.15.2
pipenv install --dev
pipenv shell

Also tried running the examples separately and it gives me the same errors. Would you have any idea on what may I be doing wrong?

Are you still able to run those examples? If yes, could you share more details about the settings you are using?

Thanks in advance! log.txt

mrahtz commented 3 years ago

Hi jgocm! Sorry to hear you're having troubles.

I think this is because you're running on Windows, which I never tested on. I think the error you're getting with run_test.py might be because atari-py failed to install properly, which you might be able to fix by installing a newer version of atari-py, but I wouldn't be surprised if other things are broken on Windows too (e.g. the problem with utils_test.py, which looks like it's a problem with the way I wrote the function in question such that it just won't work on Windows). In principle I'd guess you should be able to fix the rest of the issues, but it'll be an uphill battle - I'd recommend running on a Linux machine instead, if possible. Sorry not to be of more help :(

jgocm commented 3 years ago

You are right, we tried on Ubuntu and most of the examples work fine. By now we are struggling with same issues already reported by #3 , so I think this issue can be closed and the title is more appropriate now.