RLGC-Project / RLGC

An open-source platform for applying Reinforcement Learning for Grid Control (RLGC)
Other
111 stars 31 forks source link

About the connection with java server #6

Closed hlhsu closed 4 years ago

hlhsu commented 4 years ago

Hi, I got an error about the java server when I ran ieee39_3actions3levelsresultcheck_linux.py. I am not familiar with py4j. Hope that you can give me some help. Thank you.

(RL_Challenge) hlhsu@hlhsu-Vostro-5481:~/Documents/RLGC/src/py$ python ieee39_3actions3levelsresultcheck_linux.py /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /home/hlhsu/anaconda3/envs/RL_Challenge/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) Traceback (most recent call last): File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 977, in _get_connection connection = self.deque.pop() IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 1115, in start self.socket.connect((self.address, self.port)) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "ieee39_3actions3levelsresultcheck_linux.py", line 38, in case_files_array = gateway.new_array(gateway.jvm.String, 2) File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 1695, in getattr "\n" + proto.END_COMMAND_PART) File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 1031, in send_command connection = self._get_connection() File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 979, in _get_connection connection = self._create_connection() File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 985, in _create_connection connection.start() File "/home/hlhsu/.local/lib/python3.6/site-packages/py4j/java_gateway.py", line 1127, in start raise Py4JNetworkError(msg, e) py4j.protocol.Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:25006)

qhuang-pnl commented 4 years ago

These jupyter notebooks have not been updated to syn with the source code development. I tried to update it to show how to set it up the environment. Please refer to this update: https://github.com/RLGC-Project/RLGC/commit/4747ba78cbc26c797b7b54233eb98a2e2087b26f

Please let me know if it still does not work for you.