StanfordVL / behavior

Code to evaluate a solution in the BEHAVIOR benchmark: starter code, baselines, submodules to iGibson and BDDL repos
MIT License
56 stars 7 forks source link

TypeError: argument of type 'ABCMeta' is not iterable #6

Open Colin-KelinLi opened 2 years ago

Colin-KelinLi commented 2 years ago

Hi,

I encountered this error when I was trying to run this command: 'python -m behavior.benchmark.behavior_benchmark --agent-class PPO --ckpt-path /tmp/my_checkpoint --split cleaning_toilet'.

It seems that because of loading the checkpoints. Do you know how to fix it?

Many thanks!

Colin-KelinLi commented 2 years ago

Screenshot 2022-05-26 09:48:35

Hi,

The error is posted. I am using stable_baselin 3 = 1.5.0, torch = 1.11.0

roberto-martinmartin commented 2 years ago

Hi! Yes, we are seeing some issues with stable_baselines ourself, even importing PPO crashes. Do you need stable baselines for your work? Otherwise, I would recommend commenting out the imports until they fix the issues.

roberto-martinmartin commented 2 years ago

@HUSTColinLee , could you share an example of your checkpoint to help me reproduce your issue? our other issues with SB3 are gone

Colin-KelinLi commented 2 years ago

Hi! I tried the checkpoint you provided in the repository. Its path is '/behavior/behavior/benchmark/agents/checkpoints'. Here are two checkpoints: ' onboard_sensing_ppo_random.zip' and 'full_observability_ppo_random.zip'. Both of them are not working in my case.

And I encountered another problem when I was trying to implement the imitation learning baseline today. According to the documentation, the BC agent uses task observations (456) and proprioception feedback (20) as state space. But in fact, the training dataset you provided has 456 observations and 22 proprioceptions.

The above problem is not difficult to fix but I encountered another one when I run 'test_bc_agent.py'. The config file I used is 'behavior_full_observability.yaml'. It has 90 proprioceptions and 456 task observations. This code cannot run successfully, as in the training phase there are only 22 proprioceptions. The content of config file and the error are attached. Can you help me with this issue? 333 444

Many thanks!

Roadsong commented 2 years ago

@HUSTColinLee Hi Colin I basically had the same issues. It seems that the two checkpoint files do not work for current version of code. I tried simple_bc_agent.py and found the inconsistencies of dimensions of proprioception. You only need to change line 21 and 49, proprioception_dim=22 and it should work.

I think more important questions include 1) the baseline of training agents using action primitives 2) how to reproduce and replay the demo using action primitives... @roberto-martinmartin Do you have any suggestions?

Colin-KelinLi commented 2 years ago

@Roadsong Thanks for commenting. The first issue has been solved by replacing with proprioception_dim=22 in simple_bc_agent.py. The problem is when I run test_bc_agent.py, I used the model trained by simple_bc_agent.py. However, the dimension of proprioceptions is 90 from test_bac_agent.py while it is 22 for the model. This is the main reason I cannot run this code. Do you know how to fix it?

roberto-martinmartin commented 2 years ago

@HUSTColinLee , sorry for the delay. I was exploring this. The issue is a newer version of python. Are you using python 3.7? I think the breaking change is with python newer versions, e.g., 3.10. Those versions are incompatible with stable baselines

Colin-KelinLi commented 2 years ago

@roberto-martinmartin, Thanks for the reply. I am using python 3.8.3, which follows the documentation.

ChengshuLi commented 2 years ago

It might be due to opencv, stable-baselines or cloudpickle version mismatch.

Can you try these?

pip uninstall cloudpickle
pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip uninstall stable-baselines3

pip install stable-baselines3==1.5.0
pip install cloudpickle==2.1.0
pip install opencv-contrib-python==4.5.5.64
Arpitrf commented 2 years ago

Hello @ChengshuLi @roberto-martinmartin I am facing the same issue as @HUSTColinLee : "the dimension of proprioceptions is 90 from test_bac_agent.py while it is 22 for the model". Running all the pip installs (as you've mentioned previously) did not solve this issue. How to go about this? My python version is Python 3.8.13

oliviaylee commented 1 year ago

Hi, I'm getting the same error as in the second comment. I am running the following: python -m behavior.benchmark.behavior_benchmark --agent-class="PPO" --ckpt-path=".../behavior/benchmark/agents/checkpoints/onboard_sensing_ppo_random.zip". How was it resolved?