Skip to content
New issue

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

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

Already on GitHub? # to your account

[Fix] Fix numpy ValueError in update_infos_to_v2.py #2162

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

ZLTJohn
Copy link
Contributor

@ZLTJohn ZLTJohn commented Dec 20, 2022

Motivation

Fix numpy value assignment error. I was updating an info.pkl generated from an older mmdet3d of v1.0.0rc2, via command
python tools/dataset_converters/update_infos_to_v2.py --dataset nuscenes --pkl-path ./data/nus_rc2/nuscenes_infos_val.pkl --out-dir ./data/nus_v2
I encountered this error:
File "tools/dataset_converters/update_infos_to_v2.py", line 336, in update_nuscenes_infos lidar2sensor[:3, 3] = -1 * np.matmul(rot.T, trans.reshape(3, 1))
ValueError: could not broadcast input array from shape (3,1) into shape (3,)

Modification

In update_infos_to_v2.py, I simply changed all lidar2sensor[:3, 3] = -1 * np.matmul(rot.T, trans.reshape(3, 1)) to lidar2sensor[:3, 3:4] = -1 * np.matmul(rot.T, trans.reshape(3, 1))

@CLAassistant
Copy link

CLAassistant commented Dec 20, 2022

CLA assistant check
All committers have signed the CLA.

@ZLTJohn ZLTJohn closed this Dec 20, 2022
@ZLTJohn ZLTJohn changed the title ## Motivation Fix numpy ValueError in update_infos_to_v2.py Dec 20, 2022
@ZLTJohn ZLTJohn reopened this Dec 20, 2022
@JingweiZhang12 JingweiZhang12 changed the title Fix numpy ValueError in update_infos_to_v2.py [Fix] Fix numpy ValueError in update_infos_to_v2.py Dec 22, 2022
@ZwwWayne ZwwWayne merged commit edc468b into open-mmlab:dev-1.x Dec 27, 2022
@jason102811
Copy link

Dear zltjohn,
First of all, we want to express our gratitude for your significant PR in the MMDet project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR.
As a valued contributor, we would also like to invite you to join our Special Interest Group (SIG) private channel, where you can share your experiences, ideas, and build connections with like-minded peers.
Join us :https://discord.gg/raweFPmdzG
To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. We look forward to seeing you there!
Also,if you have WeChat,welcome to join our community on WeChat. You can add our assistant :openmmlabwx,or scan the following QR code to join us. Please add "mmsig + Github ID" as a remark when adding friends:)
Best regards! @ZLTJohn

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

Successfully merging this pull request may close these issues.

6 participants