Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The info returned by step() must be a python dictionary, actual type: <class 'str'> #89

Open
GeorgeFrangulea opened this issue Aug 4, 2023 · 1 comment

Comments

@GeorgeFrangulea
Copy link

Hello,

Did anyone encounter the below error? I have re-did my anaconda env and I do not know what I changed but my code does not compile anymore. Keeps coming with these warning that suggests the ns3 env needs upgraded but this was not the case few days ago.
I would be very grateful if anyone could let me know the right python version to use, TensorFlow, gym etc.
Thanks.
BR,
George

Channel: 1 CCA: 1 RxPower: -56.6436
Channel: 2 CCA: 0 RxPower: -76.9897
Channel: 3 CCA: 0 RxPower: -76.9897
MyGetObservation: [0, 1, 0, 0]
MyGetReward: -1
MyGetGameOver: 0
MyGetExtraInfo: info
/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/utils/passive_env_checker.py:219: DeprecationWarning: WARN: Core environment is written in old step API which returns one bool instead of two. It is recommended to rewrite the environment with new step API.
logger.deprecation(
/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/utils/passive_env_checker.py:141: UserWarning: WARN: The obs returned by the step() method was expecting numpy array dtype to be uint64, actual type: int64
logger.warn(
/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/utils/passive_env_checker.py:165: UserWarning: WARN: The obs returned by the step() method is not within the observation space.
logger.warn(f"{pre} is not within the observation space.")
Traceback (most recent call last):
File "/home/dawn_redwood/ns-3-dev/contrib/opengym/examples/interference-pattern/./cognitive-agent-v1.py", line 209, in
next_state, reward, done, _ = env.step(action)
File "/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/wrappers/order_enforcing.py", line 37, in step
return self.env.step(action)
File "/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/wrappers/env_checker.py", line 37, in step
return env_step_passive_checker(self.env, action)
File "/home/dawn_redwood/anaconda3/envs/ns-3.39.1/lib/python3.9/site-packages/gym/utils/passive_env_checker.py", line 261, in env_step_passive_checker
assert isinstance(
AssertionError: The info returned by step() must be a python dictionary, actual type: <class 'str'>

@Linsooon
Copy link

I encountered this error too. This errors is because of the new OpenAI Gym framework which is mentioned in Example section of README
Hope this help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants