MariaPriisalu / spl

Semantic Synthesis of Pedestrian Locomotion
9 stars 3 forks source link

How do I load commonUtils #5

Open wangxudong1998 opened 1 year ago

wangxudong1998 commented 1 year ago

When I run RLmain.py or evaluate.py in my pycharm, it reports the error:

Car var [[1.] [1.] [1.]] Car var [-0.1]

True Restored weights Load commonUtils/PFNNBaseCode/ Couldn't load file commonUtils/PFNNBaseCode/Parameters/pfnn/Xmean.bin

And when I try to run with mobaxterm, it reports another error:

Traceback (most recent call last): File "RL/evaluate.py", line 7, in from settings import RANDOM_SEED File "/home/wangxd/spl/RL/settings.py", line 12, in from commonUtils.ReconstructionUtils import LAST_CITYSCAPES_SEMLABEL ModuleNotFoundError: No module named 'commonUtils'

I don't know why it can't import this package. Please reply to me as soon as possible. Thank you.

MariaPriisalu commented 1 year ago

Please check that the folder commonUtils is on your python path. I would suggest that you print the contents of your pythonpath. Add the below just before the error occurs.

import sys print(sys.path)

You should be able to see the file commonUtils/PFNNBaseCode/Parameters/pfnn/Xmean.bin in your repository. Check if the folder has been correctly cloned into your local repository.

wangxudong1998 commented 1 year ago

Thanks. Now I have a new problem. When I run python CARLA_simulation_client/CARLA_0.8.2/gather_dataset.py, it reports this error.

Traceback (most recent call last): File "CARLA_simulation_client/CARLA_0.8.2/gather_dataset.py", line 19, in from carla.client import make_carla_client ModuleNotFoundError: No module named 'carla'

Then I run pip install carla. But after this it still reports an error.

Traceback (most recent call last): File "CARLA_simulation_client/CARLA_0.8.2/gather_dataset.py", line 19, in from carla.client import make_carla_client ModuleNotFoundError: No module named 'carla.client'

I want to download the Carla dataset because it reports an error when I run python RL/RLmain.py.

Traceback (most recent call last): File "RL/RLmain.py", line 1523, in main(setup) File "RL/RLmain.py", line 1500, in main rl.run(setting, time_file=f) File "RL/RLmain.py", line 224, in run supervised, tmp_net, writer) File "RL/RLmain.py", line 233, in start_run log_file, saved_files_counter, saver, sess, settings, writer, supervised, car) File "RL/RLmain.py", line 322, in train_on_carla epoch, filename_list, pos = self.get_carla_files(settings, False) File "RL/RLmain.py", line 883, in get_carla_files return epoch, filename_local_list, pos UnboundLocalError: local variable 'pos' referenced before assignment

I want to know if this issue is due to not downloading the Carla dataset.

MariaPriisalu commented 1 year ago

Hi,

You need to follow the install instructions for CARLA including the Python API at https://carla.org/ (note that you need to find the older versions). Have a look at the examples for CARLA Client-server communication. This script creates the dataset by calling the CARLA Client API and the Carla server is the simulator. So you need to run both the server and our script to gather a dataset.

Hope this helps.

wangxudong1998 commented 1 year ago

Sorry to bother you, but I have some problems with reconstructing the cityscapes and waymo dataset.

If I want to run evaluate.py on cityscapes dataset, what packages of cityscapes dataset do I need?
I already download [gtFine_trainvaltest.zip (241MB)] and [leftImg8bit_trainvaltest.zip (11GB)] from https://www.cityscapes-dataset.com/downloads/. Did I download the correct package?

I downloaded the adapted colmap according to README by git clone https://github.com/MariaPriisalu/colmap. What should I do next to create reconstructions of the cityscapes and waymo dataset. Which script should I run?

MariaPriisalu commented 1 year ago

Hi

I would kindly recommend to use the Waymo dataset instead because the data is much cleaner as the 3D data comes from LiDAR not reconstructions.

You need to run a semantic segmentator on Cityscapes to generate semantic labels for the left and the right images (not sure about the if right images are needed, I did this a few years ago). You need to also run Pannet or some other object detector to find the bounding boxes of cars and people (this proved to be more correct than the semantic segmentator). Then once you have the semantic segmentations you can run colmap/reconstruct_all.py. Some of the scenes will converge but not all. There is also a parallelised version [colmap/reconstruct_in_paralell.py](https://github.com/MariaPriisalu/spl/blob/master/colmap/reconstruct_in_paralell.py] but it is currently commented out to just run some of the reconstruction tasks on some of the scenes because I already had partial results from previous runs, so I recommend you to have a quick read through the code before running, or starting by running colmap/reconstruct_all.py.

wangxudong1998 commented 1 year ago

Hi, I want to know what file centering.p is. I don't see it in the waymo dataset. Is it meant to be rebuilt by some script?

Traceback (most recent call last): File "/home/wangxd/.pycharm_helpers/pydev/pydevd.py", line 1491, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/wangxd/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/wangxd/spl/RL/evaluate.py", line 45, in main(setup) File "/home/wangxd/spl/RL/evaluate.py", line 36, in main RL().evaluate(setting, viz=False) File "/home/wangxd/spl/RL/RLmain.py", line 1241, in evaluate self.evaluate_method_waymo(agent, sess, settings, viz) File "/home/wangxd/spl/RL/RLmain.py", line 1438, in evaluate_method_waymo filepath, agent, settings.evaluation_path, saved_files_counter) File "/home/wangxd/spl/RL/environment_waymo.py", line 92, in evaluate with open(os.path.join(file_name, "centering.p"), "rb") as metadataFileHandle: NotADirectoryError: [Errno 20] Not a directory: '/data/wangxd/waymo/val/segment-17065833287841703_2980_000_3000_000_with_camera_labels.tfrecord/centering.p'

MariaPriisalu commented 1 year ago

@AGAPIA @paduraru2009 could you please reply to this?

AGAPIA commented 1 year ago

Dear @MariaPriisalu , @wangxudong1998 , the centering.p is not specific to Waymo ,Carla or any other data. It is a file that is created when running for the first time when an episode runs on top of a scene provided by one of the datasets. You can take a look at file ReconstructionUtils.py to see the logic and where this is being created.

This file is specifically created when ReconstructionUtils.reconstruct3D_ply is being called, in the usual flow when loading a new episode, check AbstractEnvornment.set_up_episode. I'm surprised that it was not called on your side... Please use this or try to debug around to see what is the problem that you don't get there.

wangxudong1998 commented 1 year ago

Hi, @AGAPIA , thanks for your explanation, now I know centering.p is created when ReconstructionUtils.reconstruct3D_ply is called. And ReconstructionUtils.reconstruct3D_ply is called by AbstractEnvornment.set_up_episode.

However, when I run RLmain.py or evaluate.py, WaymoEnvironment.evaluate opens centering.p before calls set_up_episode. Is this because centering.p was created earlier? I can't figure out when and where centering.p is created. Do I need to run a file to create centering.p before running the Rlmain.py or evaluate.py?

paduraru2009 commented 1 year ago

Hi, it created only once if not found. Like a cache.


From: 跌倒就睡 @.> Sent: Wednesday, May 10, 2023 6:07:21 PM To: MariaPriisalu/spl @.> Cc: paduraru2009 @.>; Mention @.> Subject: Re: [MariaPriisalu/spl] How do I load commonUtils (Issue #5)

Hi, @AGAPIAhttps://github.com/AGAPIA , thanks for your explanation, now I know centering.p is created when ReconstructionUtils.reconstruct3D_ply is called. And ReconstructionUtils.reconstruct3D_ply is called by AbstractEnvornment.set_up_episode.

However, when I run RLmain.py or evaluate.py, WaymoEnvironment.evaluate opens centering.p before calls set_up_episode. Is this because centering.p was created earlier? I can't figure out when and where centering.p is created. Do I need to run a file to create centering.p before running the Rlmain.py or evaluate.py?

— Reply to this email directly, view it on GitHubhttps://github.com/MariaPriisalu/spl/issues/5#issuecomment-1542378220, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACPXQCFHX7EOYBCR4B6K3TDXFOVKTANCNFSM6AAAAAAW2B4N4Y. You are receiving this because you were mentioned.Message ID: @.***>