Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to train nuscenes dataset #3

Open
k-lam opened this issue Nov 9, 2021 · 3 comments
Open

how to train nuscenes dataset #3

k-lam opened this issue Nov 9, 2021 · 3 comments

Comments

@k-lam
Copy link

k-lam commented Nov 9, 2021

I have downloaded the nuscenes mini dataset, and prepare it according to the README.md.
I get the follow exception, when I run python run.py ./configs/non_ar_transformer_nuscenes.py. Should I provide the file path to data to run.py? And how?

File "run.py", line 73, in main
trainer.fit(model)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
result = fn(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/trainer.py", line 1073, in fit
results = self.accelerator_backend.train(model)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/accelerators/gpu_backend.py", line 51, in train
results = self.trainer.run_pretrain_routine(model)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/trainer.py", line 1224, in run_pretrain_routine
self._run_sanity_check(ref_model, model)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/trainer.py", line 1249, in _run_sanity_check
self.reset_val_dataloader(ref_model)
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/data_loading.py", line 337, in reset_val_dataloader
self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, 'val')
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/data_loading.py", line 299, in _reset_eval_dataloader
num_batches = len(dataloader) if _has_len(dataloader) else float('inf')
File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/data_loading.py", line 70, in _has_len
raise ValueError('Dataloader returned 0 length.'
ValueError: Dataloader returned 0 length. Please make sure that your Dataloader at least returns 1 batch

@k-lam
Copy link
Author

k-lam commented Nov 11, 2021

I have fixed it. We should change the dir path in line 82 of nuscenes.py file. The path must be the $SAVE_ROOT, where I run the script:

        python scripts/nuscenes_preprocess.py $YOUR_NUSCENES_DATA_ROOT $SAVE_ROOT -v $NUSCENES_VERSION

@Salem-95
Copy link

Salem-95 commented Mar 16, 2022

Hello, @k-lam. I have the same problem.
截图_20225716025739
did you mean replace the "{self.root_dir}/annotations" to "SAVE_ROOT"? But after that, the problem still exists.
The contents of my SAVE_ROOT as follows:
截图_20220416030454
截图_20220216030240
And After replacing the "{self.root_dir}/annotations" to "SAVE_ROOT/frames_ann", the problem also exists.
Could you tell me how you solved it in detial, please? Thank you very much.

@Salem-95
Copy link

I have solved it. Since the program has been run before, the "os.path.exists(cache_dir)" is True. And "force_regenerate" default is False. So the "self._make_cache(cache_dir, scenes_list_file)" didn't run again after modifing the "SAVE_ROOT/frames_ann". Just delete the folder "cache_dir".
截图_20223216073211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants