Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Fix bug in visualize.py and add Open3D-based visualization #87

Merged
merged 1 commit into from
May 20, 2022

Conversation

suyunzzz
Copy link
Contributor

@suyunzzz suyunzzz commented Apr 7, 2022

Fix a bug in visualize.py and add Open3D-based visualization.

@zhijian-liu
Copy link
Contributor

zhijian-liu commented Apr 8, 2022

Thanks for the contribution! The newly added visualizer is not used right now. Is open3d an alternative to mlab? If so, could you please add an option so that we can choose the visualization backend.

@zhijian-liu zhijian-liu self-requested a review April 8, 2022 16:33
@zhijian-liu zhijian-liu changed the title Fix bug in visualize.py Fix bug in visualize.py and add Open3D-based visualization Apr 8, 2022
@zhijian-liu zhijian-liu linked an issue Apr 8, 2022 that may be closed by this pull request
@zhijian-liu zhijian-liu linked an issue Apr 22, 2022 that may be closed by this pull request
@zhijian-liu zhijian-liu mentioned this pull request Apr 22, 2022
@suyunzzz suyunzzz force-pushed the develop branch 2 times, most recently from 54674dc to 53a281c Compare May 5, 2022 06:01
@suyunzzz
Copy link
Contributor Author

suyunzzz commented May 5, 2022

hello,zhijian,
I am a git newbie, i dont know whether "push -f" is right, if there are some mistake please tell me,:)🤣

@QuasarsZ
Copy link

QuasarsZ commented May 6, 2022

Hello, @suyunzzz
I've downloaded the file which you updated yesterday.
And I try to run the visualize code by default command:

python visualize.py

But I encounter some error about:

File "visualize.py", line 360, in
outputs = model(inputs)
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 84])

The parse argument is:

Model: SemanticKITTI_val_SPVNAS@65GMACs (default)
Velodyne_dir: sample_data(default)
visualize_backend: open3d(default)

Do you know how to solve this problem?
Hope you can give me some advise.
Thanks a lot!! 谢谢!

@zhijian-liu
Copy link
Contributor

zhijian-liu commented May 6, 2022

Hi @suyunzzz, thanks for the updates. Could you please remove init and all .pyc files? Also, the sample data is now stored under assets. Please remove sample_data as well. Thank you!

@zhijian-liu
Copy link
Contributor

zhijian-liu commented May 6, 2022

Btw, could you also reformat the code according to pre-commit (see https://github.com/mit-han-lab/spvnas/runs/6327544860?check_suite_focus=true for more details)? Thanks!

@zhijian-liu
Copy link
Contributor

zhijian-liu commented May 6, 2022

Hello, @suyunzzz I've downloaded the file which you updated yesterday. And I try to run the visualize code by default command:

python visualize.py

But I encounter some error about:

File "visualize.py", line 360, in
outputs = model(inputs)
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 84])

The parse argument is:

Model: SemanticKITTI_val_SPVNAS@65GMACs (default)
Velodyne_dir: sample_data(default)
visualize_backend: open3d(default)

Do you know how to solve this problem? Hope you can give me some advise. Thanks a lot!! 谢谢!

@QuasarsZ, could you please double-check the input size: inputs.F.shape?

@QuasarsZ
Copy link

QuasarsZ commented May 9, 2022

Hello, @zhijian-liu. Thanks for your response.

I run the visualize code with:

python visualize.py --velodyne-dir ./dataset/semantic-kitti/00/velodyne/

And the input size is:

torch.Size([91852, 4])

Is my velodyne-dir set incorrectly?

@suyunzzz
Copy link
Contributor Author

suyunzzz commented May 9, 2022

Hello, @zhijian-liu. Thanks for your response.

I run the visualize code with:

python visualize.py --velodyne-dir ./dataset/semantic-kitti/00/velodyne/

And the input size is:

torch.Size([91852, 4])

Is my velodyne-dir set incorrectly?

Does it work if you use a original visualize.py?

@suyunzzz
Copy link
Contributor Author

suyunzzz commented May 9, 2022

Btw, could you also reformat the code according to pre-commit (see https://github.com/mit-han-lab/spvnas/runs/6327544860?check_suite_focus=true for more details)? Thanks!
hello, zhijian,
I am not sure that is need format code manually? or automatic?🤣

@QuasarsZ
Copy link

QuasarsZ commented May 9, 2022

Hi, @suyunzzz. Thank's for your reply.

Run original visualize.py will get another error. (#90)

Then, I only modify this:

inds, labels, inverse_map = sparse_quantize(pc_,
feat_,
voxel_size,
return_index=True,
return_inverse=True)

to

coords_, inds, inverse_map = sparse_quantize(pc_,
return_index=True,
return_inverse=True)

And I will get error message about:

File "visualize.py", line 360, in
outputs = model(inputs)
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 84])

@clee-ai
Copy link
Contributor

clee-ai commented May 16, 2022

@suyunzzz To use precommit,

pip install pre-commit
pre-commit install
pre-commit run -a

It should reformat the code and then format the code before every commit.

@suyunzzz
Copy link
Contributor Author

@suyunzzz To use precommit,

pip install pre-commit
pre-commit install
pre-commit run -a

It should reformat the code and then format the code before every commit.

thanks, it seems work😄

add open3d backend for visualization

reformat visualize.py
Copy link
Contributor

@zhijian-liu zhijian-liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really nice @suyunzzz. Thank you for your great efforts!

@zhijian-liu zhijian-liu merged commit 69750e9 into mit-han-lab:master May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

visualize.py has bugs ImportError: cannot import name 'sparse_quantize
4 participants