tkn-tub / ns3-gym

ns3-gym - The Playground for Reinforcement Learning in Networking Research
GNU General Public License v2.0
524 stars 198 forks source link

problem in multi-agent "TypeError: 10 has type numpy uint 64, but expected one of : int" #55

Closed jnbai517 closed 3 years ago

jnbai517 commented 3 years ago

Dear @pgawlowicz and ns3-gym team,

Just a question and some echos. After successfully running the agent1.py, I got this error:

root@jnbai-ThinkPad-T460:/ns29/ns-allinone-3.29/ns-3.29/scratch/multi-agent# ./agent1.py Waiting for simulation script to connect on port: tcp://localhost:5555 Please start proper ns-3 simulation script using ./waf --run "..." Observation space: Dict(box:Box(0, 10, (5,), uint64), discrete:Discrete(5)) None Action space: Dict(box:Box(0, 10, (5,), uint64), discrete:Discrete(5)) None Step: 0 ---obs: (<google.protobuf.pyext._message.RepeatedScalarContainer object at 0x7fa17eab9a40>, 8) ---action: OrderedDict([('box', array([10, 6, 3, 7, 1], dtype=uint64)), ('discrete', 4)]) Step: 1 Done Traceback (most recent call last): File "./agent1.py", line 39, in <module> obs, reward, done, info = env.step(action) File "/usr/local/lib/python3.6/dist-packages/ns3gym/ns3env.py", line 401, in step response = self.ns3ZmqBridge.step(action) File "/usr/local/lib/python3.6/dist-packages/ns3gym/ns3env.py", line 229, in step self.send_actions(actions) File "/usr/local/lib/python3.6/dist-packages/ns3gym/ns3env.py", line 215, in send_actions actionMsg = self._pack_data(actions, self._action_space) File "/usr/local/lib/python3.6/dist-packages/ns3gym/ns3env.py", line 352, in _pack_data subData = self._pack_data(subAction, subActSpaceType) File "/usr/local/lib/python3.6/dist-packages/ns3gym/ns3env.py", line 316, in _pack_data boxContainerPb.uintData.extend(actions) TypeError: 10 has type numpy.uint64, but expected one of: int How can I correct it?

Again many thanks for your amazing works on this research project, :)