uzh-rpg / agile_flight

Developing and Comparing Vision-based Algorithms for Vision-based Agile Flight
MIT License
152 stars 55 forks source link

unexpected keyword argument 'policy_base' when running python3 -m python.run_vision_ppo --render 0 --train 1 #80

Closed Glanfaloth closed 2 years ago

Glanfaloth commented 2 years ago

Hi, when I run the policy training via python3 -m python.run_vision_ppo --render 0 --train 1, I got this;

[VecEnvBase]   Load Unity configuration.
[VecEnvBase]   Load Simulation configuration.
[VecEnvBase]   100 vectorized enviromnets created. 
Vectorized Environment:
obs dim    =            [55]
act dim    =            [4]
rew dim    =            [5]
einfo dim  =            [0]
img width  =            [320]
img height =            [240]
num_envs   =            [100]
num_thread =            [10]
seed       =            [1]
scene_id   =            [0]
[VecEnvBase]   Load Unity configuration.
[VecEnvBase]   Load Simulation configuration.
[VecEnvBase]   1 vectorized enviromnets created. 
Vectorized Environment:
obs dim    =            [55]
act dim    =            [4]
rew dim    =            [5]
einfo dim  =            [0]
img width  =            [320]
img height =            [240]
num_envs   =            [1]
num_thread =            [10]
seed       =            [1]
scene_id   =            [0]
Traceback (most recent call last):
  File "/local/home/yeltao/anaconda3/envs/agileflight/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/local/home/yeltao/anaconda3/envs/agileflight/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/local/home/yeltao/thesis_ws/agile_flight/envtest/python/run_vision_ppo.py", line 125, in <module>
    main()
  File "/local/home/yeltao/thesis_ws/agile_flight/envtest/python/run_vision_ppo.py", line 74, in main
    model = PPO(
  File "/local/home/yeltao/thesis_ws/agile_flight/flightmare/flightpy/flightrl/rpg_baselines/torch/common/ppo.py", line 108, in __init__
    super(PPO, self).__init__(
  File "/local/home/yeltao/thesis_ws/agile_flight/flightmare/flightpy/flightrl/rpg_baselines/torch/common/on_policy_algorithm.py", line 80, in __init__
    super(OnPolicyAlgorithm, self).__init__(
TypeError: __init__() got an unexpected keyword argument 'policy_base'

How do I fix this? Thank you!

maokat12 commented 1 year ago

Hi, I'm running into the same error message. Can I ask how you fixed it?

Glanfaloth commented 1 year ago

Hi, you can fix it in on_policy_algorithm.py according to the error messages.

yifeichen2024 commented 4 months ago

Hi, you can fix it in on_policy_algorithm.py according to the error messages.

Hi i have the same error. I am not quite understand your solution. I comment the line with error. but it shows the same error with another keyword argument 'create_eval_env'. I think maybe it's a problem with stable_baselines3 version. Could you please tell me which version of stable_baselines3 are you using?