SJTU-ViSYS-team / VisFly

This is a fast and versatile simulator for training vision-based flight of drones.
MIT License
26 stars 2 forks source link

bug on VisFly/utils/sceneDatasets.py load_scenes() function when running in Pycharm2024.2.4 #11

Closed zhaozilong2zl closed 1 month ago

zhaozilong2zl commented 1 month ago

hello ViSYS team! when i try to run the code in pycharm i meet a bug about scene_paths (but the same code can run on VSCode, no idea why ), i have tried except the scene_paths and let it be'[ ]' but still can't make it work

i am new to habitat-sim, can you provide some idea on how to fix this on pycharm, or what part in the habitat-sim documentation can i get some help about the load_scenes() function in utils/sceneDatasets.py

thanks for your effort!

Traceback (most recent call last): File "/opt/pycharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1570, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/opt/pycharm/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/examples/crossing/rl.py", line 169, in main() File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/examples/crossing/rl.py", line 127, in main model.learn(training_params["learning_step"]) File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/utils/algorithms/ppo.py", line 1002, in learn return super().learn( File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/utils/algorithms/ppo.py", line 970, in learn return super().learn( File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/utils/algorithms/ppo.py", line 565, in learn total_timesteps, callback = self._setup_learn( File "/home/anaconda3/envs/VisFly/lib/python3.9/site-packages/stable_baselines3/common/base_class.py", line 423, in _setup_learn self._last_obs = self.env.reset() # type: ignore[assignment] File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/envs/MultiNavigationEnv.py", line 68, in reset obs = super().reset() File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/envs/multiDroneGymEnv.py", line 173, in reset self.envs.reset() File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/envs/base/droneEnv.py", line 219, in reset self.sceneManager.load_scenes() File "/home/Proj_folder/UAV_3D/habitat_sim_based/VisFly/My_Project_Using_VisFly/VisFly/utils/sceneDatasets.py", line 690, in load_scenes scene_paths = next(self._scene_loader) StopIteration python-BaseException

zhaozilong2zl commented 1 month ago

i found thar this error was caused by the different working directory of pycharm, which make ChildrenPathDataset(self.root_path, type=scene_type, semantic=semantic) get empty due to the wrong file dirctionary(which should be a json file)

sorry to disturb