但执行失败。例程代码在我个人电脑上运行没有问题,所以想问是不是AISTUDIO的配置有些问题呢?
Traceback (most recent call last):
File "run.py", line 58, in
train.main()
File "/mnt/code_20220901113948/train.py", line 78, in main
env = gym.make('CartPole-v0')
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 183, in make
def _check_name_exists(ns: Optional[str], name: str):
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 125, in make
nondeterministic: If the observation of an environment cannot be repeated with the same initial state, random number generator state and actions.
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 88, in make
f"Malformed environment ID: {id}."
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 17, in load
SupportsFloat,
File "/opt/_internal/cpython-3.7.0/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/classic_control/init.py", line 2, in
from gym.envs.classic_control.cartpole import CartPoleEnv
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/classic_control/cartpole.py", line 18, in
class CartPoleEnv(gym.Env[np.ndarray, Union[int, np.ndarray]]):
TypeError: 'type' object is not subscriptable
/mnt
[INFO]: train job failed! train_ret: 1
在AI Studio 的脚本模式运行DQN例程报错 我在run.py中重新安装依赖库 import os import train myCmd = 'pip uninstall -y parl' os.system(myCmd) myCmd = 'pip uninstall -y gym' os.system(myCmd) myCmd = 'pip uninstall -y pandas scikit-learn' os.system(myCmd) myCmd = 'pip install gym' os.system(myCmd) myCmd = 'pip install parl' os.system(myCmd) myCmd = 'pip list --format=columns' os.system(myCmd) train.main()
但执行失败。例程代码在我个人电脑上运行没有问题,所以想问是不是AISTUDIO的配置有些问题呢? Traceback (most recent call last): File "run.py", line 58, in
train.main()
File "/mnt/code_20220901113948/train.py", line 78, in main
env = gym.make('CartPole-v0')
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 183, in make
def _check_name_exists(ns: Optional[str], name: str):
File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 125, in make