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

ModuleNotFoundError: No module named 'gym.spaces.dict_space' #20

Open
AmitMandliya opened this issue Mar 21, 2020 · 2 comments
Open

ModuleNotFoundError: No module named 'gym.spaces.dict_space' #20

AmitMandliya opened this issue Mar 21, 2020 · 2 comments

Comments

@AmitMandliya
Copy link

bin/examine.py examples/hide_and_seek_quadrant.jsonnet examples/lock_and_return.npz


Inferred:
	names: examples/hide_and_seek_quadrant.jsonnet examples/lock_and_return.npz
	arguments: {}


/home/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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/amitmandliya/.local/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)])
/home/amitmandliya/.local/lib/python3.7/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
2020-03-21 01:24:02,468 From /home/amitmandliya/amit/multi-agent-emergence-environments/ma_policy/load_policy.py:57: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

2020-03-21 01:24:02,468 From /home/amitmandliya/amit/multi-agent-emergence-environments/ma_policy/load_policy.py:58: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-03-21 01:24:02,468 From /home/amitmandliya/amit/multi-agent-emergence-environments/ma_policy/load_policy.py:61: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2020-03-21 01:24:02.475922: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-03-21 01:24:02.498972: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2099940000 Hz
2020-03-21 01:24:02.499333: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2d669a0 executing computations on platform Host. Devices:
2020-03-21 01:24:02.499353: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
Traceback (most recent call last):
  File "bin/examine.py", line 91, in <module>
    main()
  File "/home/amitmandliya/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/amitmandliya/.local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/amitmandliya/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/amitmandliya/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "bin/examine.py", line 68, in main
    for i, name in enumerate(policy_names)]
  File "bin/examine.py", line 68, in <listcomp>
    for i, name in enumerate(policy_names)]
  File "/home/amitmandliya/amit/multi-agent-emergence-environments/ma_policy/load_policy.py", line 65, in load_policy
    policy_fn_and_args_raw = pickle.loads(policy_dict['policy_fn_and_args'])
ModuleNotFoundError: No module named 'gym.spaces.dict_space'

@yangperasd
Copy link

use gym 0.10.8

@HACLANG
Copy link

HACLANG commented Dec 4, 2021

This problem also occurred when I tried to convert it to tf2. After this problem was solved, there would be a tf2 version compatibility problem (tf.contrib).
So it’s best to follow the original environment configuration,I configured it to work according to the original environment

tensorflow/models#7767 (comment)

tensorflow.contrib was removed in TF2. Tensorflow Core released a utility to convert your TF 1.x scripts to TF2.0 which can be found here: https://www.tensorflow.org/guide/upgrade

It was brought to my attention that the utility mentioned here cannot convert the tf.contrib library, so this method does not work. I will leave the comment up to save someone's time in the future.

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

3 participants