/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/gym/core.py:27: UserWarning: [33mWARN: Gym minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+[0m "Gym minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+" Traceback (most recent call last): File "run_re2.py", line 81, in <module> parameters = Parameters(parser) # Inject the cla arguments in the parameters object File "/home/zhangmengjie/PID/Python/ERL-Re2-main/parameters.py", line 117, in __init__ self.wandb = wandb.init(project="TSR",name=self.name) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_init.py", line 1173, in init raise e File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_init.py", line 1150, in init wi.setup(kwargs) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_init.py", line 172, in setup self._wl = wandb_setup.setup(settings=setup_settings) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_setup.py", line 327, in setup ret = _setup(settings=settings) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_setup.py", line 320, in _setup wl = _WandbSetup(settings=settings) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_setup.py", line 303, in __init__ _WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pid=pid) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_setup.py", line 108, in __init__ self._settings = self._settings_setup(settings, self._early_logger) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_setup.py", line 128, in _settings_setup s._apply_env_vars(self._environ, _logger=early_logger) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_settings.py", line 1597, in _apply_env_vars self.update(env, source=Source.ENV) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_settings.py", line 1453, in update self.__dict__[key].update(settings.pop(key), source=source) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_settings.py", line 425, in update self._value = self._validate(self._preprocess(value)) File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_settings.py", line 386, in _validate if not v(value): File "/home/zhangmengjie/anaconda3/envs/torch/lib/python3.6/site-packages/wandb/sdk/wandb_settings.py", line 898, in _validate_mode raise UsageError(f"Settings field `mode`: {value!r} not in {choices}") wandb.errors.UsageError: Settings field `mode`: '' not in {'online', 'run', 'dryrun', 'disabled', 'offline'}
时间: 2023-08-11 12:04:48 浏览: 178
这个错误提示是由于您在运行中使用的Wandb库的设置中,`mode`字段的值为空。根据错误信息,可选的`mode`字段的值应该是 `online`, `run`, `dryrun`, `disabled`, 或者 `offline`。
您可以检查一下您代码中关于Wandb库的设置部分,确认是否正确设置了`mode`字段的值。您可以将其设置为其中一个有效的选项,如 `'online'` 或者 `'offline'`,然后重新运行脚本。
另外,请确保您已经正确安装了Wandb库,并且所使用的Python版本符合Wandb库的要求。根据警告信息显示,Gym库建议使用Python 3.7 或更高版本,您可以尝试更新您的Python版本以解决这个问题。
如果问题仍然存在,请提供更多相关的代码和错误信息,以便我能够更好地帮助您解决问题。
相关问题
Traceback (most recent call last): File "run_re2.py", line 95, in <module> env.seed(parameters.seed) File "/home/zhangmengjie/anaconda3/envs/torch1/lib/python3.7/site-packages/gym/core.py", line 241, in __getattr__ return getattr(self.env, name) File "/home/zhangmengjie/anaconda3/envs/torch1/lib/python3.7/site-packages/gym/core.py", line 241, in __getattr__ return getattr(self.env, name) File "/home/zhangmengjie/anaconda3/envs/torch1/lib/python3.7/site-packages/gym/core.py", line 241, in __getattr__ return getattr(self.env, name) AttributeError: 'AntEnv' object has no attribute 'seed'中文回答
这个错误是由于在运行 "run_re2.py" 文件时,对一个名为 'AntEnv' 的对象调用了 'seed' 属性,但是该对象并没有定义 'seed' 属性。可能的原因是在定义 'AntEnv' 类时忘记添加 'seed' 属性。你需要检查代码并确保 'AntEnv' 类中定义了 'seed' 属性,或者在使用该属性之前进行判断。
for topic, msg, t in bag.read_messages(): File "/home/baidu/anaconda3/envs/python36/lib/python3.6/site-packages/rosbag/bag.py", line 2696, in read_messages yield self.seek_and_read_message_data_record((entry.chunk_pos, entry.offset), raw, return_connection_header) File "/home/baidu/anaconda3/envs/python36/lib/python3.6/site-packages/rosbag/bag.py", line 2859, in seek_and_read_message_data_record msg_type = _get_message_type(connection_info) File "/home/baidu/anaconda3/envs/python36/lib/python3.6/site-packages/rosbag/bag.py", line 1910, in _get_message_type message_type = genpy.dynamic.generate_dynamic(info.datatype, info.msg_def)[info.datatype] File "/home/baidu/anaconda3/envs/python36/lib/python3.6/site-packages/genpy/dynamic.py", line 180, in generate_dynamic mod = __import__(os.path.basename(tmp_file.name)[:-3]) File "/tmp/genpy_zyoi0xpr/tmpxiplcd9k.py", line 10 class ___apollo.test.CaseSample(genpy.Message): ^ SyntaxError: invalid syntax
这个错误是由于在生成动态消息类型时发生了语法错误。根据错误提示,有一个类名为"___apollo.test.CaseSample"的消息类型生成时出现了无效的语法。可能有几个原因导致这个错误:
1. 类名中包含了无效字符或特殊字符。
2. 类名中使用了保留字或关键字。
3. 类名中存在语法错误。
请检查生成动态消息类型的代码,并确保类名的语法正确,不包含无效字符或特殊字符,并且不使用保留字或关键字作为类名。如果仍然存在问题,请提供生成动态消息类型的代码,以便我能更好地帮助你解决问题。
阅读全文