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

codes running issues #5

Closed
Z-Lee-corder opened this issue Apr 18, 2022 · 6 comments
Closed

codes running issues #5

Z-Lee-corder opened this issue Apr 18, 2022 · 6 comments

Comments

@Z-Lee-corder
Copy link

Hi, I tried to tun your source code,but the following error occurred:“AttributeError: 'Tensor' object has no attribute 'isnan”
The wrong sentence is “points_out_of_range = ((xyz_local_grid < 0) | (xyz_local_grid >= grid_size) | (xyz_local_grid.isnan())) .any(-1).flatten()”in the folder “pcdet/utils/density_utils.py".

What is the cause and how to improve it?

@jskhu
Copy link
Member

jskhu commented Apr 18, 2022

Could you provide me with pip freeze and the whole stack trace?

@Z-Lee-corder
Copy link
Author

I use the following version: python=3.6 pytorch=1.5.0 and cuda 10.1
Are the versions of these packages too low to cause this error?

@Z-Lee-corder
Copy link
Author

I have used the same environment as you mentioned, but the error still occurred, the whole stack trace is following:
Traceback (most recent call last):
File "/media/lizheng/datum/codes/PDV/tools/train_utils/train_utils.py", line 93, in train_model
dataloader_iter=dataloader_iter
File "/media/lizheng/datum/codes/PDV/tools/train_utils/train_utils.py", line 38, in train_one_epoch
loss, tb_dict, disp_dict = model_func(model, batch)
File "/media/lizheng/datum/codes/PDV/pcdet/models/init.py", line 42, in model_func
ret_dict, tb_dict, disp_dict = model(batch_dict)
File "/home/lizheng/anaconda3/envs/pcdet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/media/lizheng/datum/codes/PDV/pcdet/models/detectors/pdv.py", line 11, in forward
batch_dict = cur_module(batch_dict)
File "/home/lizheng/anaconda3/envs/pcdet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/media/lizheng/datum/codes/PDV/pcdet/models/roi_heads/pdv_head.py", line 252, in forward
positional_input = self.get_positional_input(batch_dict['points'], batch_dict['rois'], local_roi_grid_points)
File "/media/lizheng/datum/codes/PDV/pcdet/models/roi_heads/pdv_head.py", line 213, in get_positional_input
return_centroid=self.pool_cfg.ATTENTION.POSITIONAL_ENCODER == 'density_centroid')
File "/media/lizheng/datum/codes/PDV/pcdet/utils/density_utils.py", line 80, in find_num_points_per_part_multi
points_out_of_range = ((xyz_local_grid < 0) | (xyz_local_grid >= grid_size) | (xyz_local_grid.isnan())).any(-1).flatten()
AttributeError: 'Tensor' object has no attribute 'isnan'
python-BaseException

@jskhu
Copy link
Member

jskhu commented Apr 19, 2022

Have you tried running the provided tests in PDV/tests, specifically this test suite?

https://github.com/TRAILab/PDV/blob/main/tests/utils/test_density_utils.py#L120-L279

And to confirm, you have the same environment as follows?

  • Linux (tested on Ubuntu 18.04)
  • Python 3.8
  • PyTorch 1.7
  • CUDA 10.2

If it still doesn't work, I would suggest trying to run the code with the provided docker image.

@jskhu
Copy link
Member

jskhu commented Apr 19, 2022

I also saw another Github issue that may help you solve your problem (yuantn/MI-AOD#2 (comment)). The code change seemed to work fine on my end, but I haven't tested this enough to guarantee that it will also work.

@Z-Lee-corder
Copy link
Author

Thank you!I have updated the version of pytorch to 1.7. The issues have been solved.

@jskhu jskhu closed this as completed Apr 21, 2022
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