TeaganLi / HouseExpo

HouseExpo: A Large-scale 2D Indoor Layout Dataset
MIT License
117 stars 24 forks source link

Error in training #3

Open RemaDaher opened 4 years ago

RemaDaher commented 4 years ago

Hello, When I run the following command:

python -m baselines.run --alg=ppo2 --env=RobotExploration-v0 --network=cnn --num_timesteps=2e7

I get the following error:

Traceback (most recent call last): File "/home/rema/anaconda3/envs/housexpo/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/rema/anaconda3/envs/housexpo/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/rema/Thesis/baselines/baselines/run.py", line 250, in main(sys.argv) File "/home/rema/Thesis/baselines/baselines/run.py", line 216, in main model, env = train(args, extra_args) File "/home/rema/Thesis/baselines/baselines/run.py", line 80, in train *alg_kwargs File "/home/rema/Thesis/baselines/baselines/ppo2/ppo2.py", line 142, in learn obs, returns, masks, actions, values, neglogpacs, states, epinfos = runner.run() #pylint: disable=E0632 File "/home/rema/Thesis/baselines/baselines/ppo2/runner.py", line 38, in run self.obs[:], rewards, self.dones, infos = self.env.step(actions) File "/home/rema/Thesis/baselines/baselines/common/vec_env/vec_env.py", line 108, in step return self.step_wait() File "/home/rema/Thesis/baselines/baselines/common/vec_env/dummy_vec_env.py", line 51, in step_wait obs, self.buf_rews[e], self.buf_dones[e], self.buf_infos[e] = self.envs[e].step(action) File "/home/rema/Thesis/baselines/baselines/bench/monitor.py", line 54, in step ob, rew, done, info = self.env.step(action) File "/home/rema/anaconda3/envs/housexpo/lib/python3.7/site-packages/gym/wrappers/time_limit.py", line 16, in step observation, reward, done, info = self.env.step(action) File "/home/rema/Thesis/HouseExpo/pseudoslam/envs/robot_exploration_v0.py", line 50, in step crush_flag = self.sim.moveRobot(action) File "/home/rema/Thesis/HouseExpo/pseudoslam/envs/simulator/pseudoSlam.py", line 418, in moveRobot if self.robotCrashed(targetPose): File "/home/rema/Thesis/HouseExpo/pseudoslam/envs/simulator/pseudoSlam.py", line 465, in robotCrashed worldPatch= worldPatchrobotPatch ValueError: operands could not be broadcast together with shapes (11,10) (11,11)

RemaDaher commented 4 years ago

I solved this in pseudoSlam.py by replacing: worldPatch= worldPatch robotPatch with: rowWorld,colWorld=np.shape(self.world)
if (py-r)>=0 and (px-r)>=0 and (py+r+1)<=rowWorld and (px+r+1)<=colWorld: worldPatch= worldPatch
robotPatch