Skip to content

How to run the program? #1

@yygbruce

Description

@yygbruce

Hi, @CrisSherban and @AleTM1 !Thank you very much for your work! I alse want to replace PID algorithm with Neural Networks!But there is not enough information about the program, and I don't know how to run it.
I run as this: python test_singleagent.py --exp ./results/save-hover-ppo-kin-pid-03.08.2022_17.26.52 --time 6 , but the erros like the following:
/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/vec_env/patch_gym.py:95: UserWarning: You loaded a model that was trained using OpenAI Gym. We strongly recommend transitioning to Gymnasium by saving that model again.
warnings.warn(
Traceback (most recent call last):
File "test_singleagent.py", line 84, in
model = PPO.load(path)
File "
/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/base_class.py", line 739, in load
model._setup_model()
File "/.Python3.8/lib/python3.8/site-packages/stable_baselines3/ppo/ppo.py", line 174, in _setup_model
super()._setup_model()
File "
/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/on_policy_algorithm.py", line 135, in _setup_model
self.policy = self.policy_class( # type: ignore[assignment]
File "/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/policies.py", line 535, in init
self._build(lr_schedule)
File "
/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/policies.py", line 592, in _build
self._build_mlp_extractor()
File "/home/bruce/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/policies.py", line 578, in _build_mlp_extractor
self.mlp_extractor = MlpExtractor(
File "/.Python3.8/lib/python3.8/site-packages/stable_baselines3/common/torch_layers.py", line 234, in init
policy_net.append(nn.Linear(last_layer_dim_pi, curr_layer_dim))
File "
/.Python3.8/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 99, in init
self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:

  • (tuple of ints size, *, tuple of names names, torch.memory_format memory_format = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False)
  • (tuple of ints size, *, torch.memory_format memory_format = None, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions