ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.99k stars 5.78k forks source link

PolicyClient Examle on windows results in: Windows fatal exception: access violation #16161

Closed RocketRider closed 3 years ago

RocketRider commented 3 years ago

I tried to run the PolicyClient example from examples (cartpole_client.py and cartpole_server.py) on Windows 10 with ray 1.3.0 and TF 2.4.0. But after a few episodes I get the following error:


trainer.train() result: <ray.rllib.agents.trainer_template.PPO object at 0x000001FB934FAE20> -> 305 episodes
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
127.0.0.1 - - [31/May/2021 14:42:30] "POST / HTTP/1.1" 200 -
Windows fatal exception: access violation

Stack (most recent call first):
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\tensorboardX\summary.py", line 250 in make_histogram
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\tensorboardX\summary.py", line 210 in histogram
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\tensorboardX\writer.py", line 546 in add_histogram
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\tune\logger.py", line 217 in on_result
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\tune\logger.py", line 321 in on_result
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\tune\trainable.py", line 821 in _log_result
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\tune\trainable.py", line 809 in log_result
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\rllib\agents\trainer.py", line 601 in log_result
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\tune\trainable.py", line 294 in train
  File "C:\Users\Admin\anaconda3\envs\ray_tf2\lib\site-packages\ray\rllib\agents\trainer.py", line 562 in train
  File "Server.py", line 129 in <module>

Pip list:

Package Version


absl-py 0.10.0 aiohttp 3.6.2 aiohttp-cors 0.7.0 aioredis 1.3.1 astar 0.93 astroid 2.4.2 astunparse 1.6.3 async-timeout 3.0.1 atari-py 0.2.6 attrs 20.1.0 backcall 0.2.0 bayesian-optimization 1.2.0 beautifulsoup4 4.9.1 blessings 1.7 Brotli 1.0.9 cachetools 4.1.1 certifi 2020.12.5 chardet 3.0.4 click 7.1.2 cloudpickle 1.3.0 cma 3.0.3 colorama 0.4.4 colorful 0.5.4 cycler 0.10.0 cytoolz 0.11.0 dash 1.17.0 dash-core-components 1.13.0 dash-html-components 1.1.1 dash-renderer 1.8.3 dash-table 4.11.0 dask 2021.2.0 decorator 4.4.2 dm-tree 0.1.5 filelock 3.0.12 Flask 1.1.2 Flask-Compress 1.8.0 flatbuffers 1.12 future 0.18.2 gast 0.3.3 google 3.0.0 google-api-core 1.22.2 google-auth 1.21.1 google-auth-oauthlib 0.4.1 google-pasta 0.2.0 googleapis-common-protos 1.52.0 gpustat 0.6.0 GPUtil 1.4.0 graphviz 0.16 grpcio 1.32.0 gym 0.17.2 h5py 2.10.0 hiredis 1.1.0 idna 2.10 imagecodecs 2021.1.11 imageio 2.9.0 ipython 7.22.0 ipython-genutils 0.2.0 isort 5.6.4 itsdangerous 1.1.0 jedi 0.18.0 Jinja2 2.11.2 joblib 1.0.0 jsonschema 3.2.0 Keras-Preprocessing 1.1.2 keyboard 0.13.5 kiwisolver 1.3.1 lazy-object-proxy 1.4.3 llvmlite 0.36.0 lz4 3.1.0 Markdown 3.2.2 MarkupSafe 1.1.1 matplotlib 3.3.4 mccabe 0.6.1 mkl-fft 1.2.0 mkl-random 1.1.1 mkl-service 2.3.0 msgpack 1.0.0 multidict 4.7.6 networkx 2.5 nevergrad 0.4.2.post5 numba 0.53.1 numpy 1.19.2 nvidia-ml-py3 7.352.0 oauthlib 3.1.0 olefile 0.46 opencensus 0.7.10 opencensus-context 0.1.1 opencv-python 4.4.0.44 opencv-python-headless 4.3.0.36 opt-einsum 3.3.0 pandas 1.1.1 parso 0.8.2 pickleshare 0.7.5 Pillow 8.1.1 pip 20.2.2 plotly 4.12.0 prometheus-client 0.8.0 prompt-toolkit 3.0.18 protobuf 3.15.8 psutil 5.7.2 py-spy 0.3.3 pyasn1 0.4.8 pyasn1-modules 0.2.8 pydot 1.4.2 pygame 2.0.0 pygame-gui 0.5.7 pyglet 1.5.0 Pygments 2.8.1 pylint 2.6.0 pyparsing 2.4.7 pyrsistent 0.16.0 PySide6 6.0.1 python-dateutil 2.8.1 python-igraph 0.9.1 pytz 2020.1 PyWavelets 1.1.1 PyYAML 5.4.1 ray 1.3.0 redis 3.5.3 requests 2.24.0 requests-oauthlib 1.3.0 retrying 1.3.3 rsa 4.6 scikit-image 0.18.1 scikit-learn 0.24.0 scipy 1.6.1 seaborn 0.11.1 setuptools 49.6.0.post20200814 shiboken6 6.0.1 six 1.15.0 snakeviz 2.1.0 soupsieve 2.0.1 tabulate 0.8.7 tensorboard 2.4.0 tensorboard-plugin-wit 1.7.0 tensorboardX 2.2 tensorflow-estimator 2.4.0 tensorflow-gpu 2.4.1 tensorflow-probability 0.12.1 termcolor 1.1.0 texttable 1.6.2 threadpoolctl 2.1.0 tifffile 2021.3.4 toml 0.10.2 toolz 0.11.1 torch 1.7.1+cu110 torchaudio 0.7.2 torchvision 0.8.2+cu110 tornado 6.1 traitlets 5.0.5 typing-extensions 3.7.4.3 urllib3 1.25.10 wcwidth 0.2.5 Werkzeug 1.0.1 wheel 0.35.1 wincertstore 0.2 wrapt 1.12.1 yarl 1.5.1

RocketRider commented 3 years ago

The issue seems to be related to the installation. I installed python without anaconda and now it is working fine.