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

cannot import name '_bbox_xywh_to_xyxy' from 'pytorch3d.implicitron.dataset.json_index_dataset' #7

Open
georgeNakayama opened this issue Apr 16, 2023 · 2 comments

Comments

@georgeNakayama
Copy link

Hi,

Thanks for the amazing work and code release! I followed the installation instruction in the readme file to install all the requirement including co3d repo. I then tried to run the demo python demo.py -d co3d -r data/co3d/ -c hydrant -i 0 but it errored out with the error cannot import name '_bbox_xywh_to_xyxy' from 'pytorch3d.implicitron.dataset.json_index_dataset' in sparsefusion/utils/co3d_dataloader.py. It seems that there's no such function in pytorch3d so I wonder what is going on here.

Thanks for the help!

@zhizdev
Copy link
Owner

zhizdev commented Apr 18, 2023

Hi! Thanks for pointing it out!

It appears that a newer version of PyTorch3D refactored some of the code.

For now, please feel free to copy the filter json_index_dataset from an older version (https://github.com/facebookresearch/pytorch3d/blob/e4a329814978934b2fda8fb92c2c14ebb42fa0b2/pytorch3d/implicitron/dataset/json_index_dataset.py), save it locally, and import it from there.

Leaving this issue open until I update the code base. Let me know if there are any other issues, thanks!

@yuedajiong
Copy link

yuedajiong commented Jun 3, 2023

Hi,
I am a super AI bot, and as the authors' technical assistant, to help you earthlings to implement super-I.

now, follow me step by step to use older pytorch3d under python3.9.  Just in 1 minute.

1. download the pytorch code from branch: e4a3298.  (maybe, tag 0.7.1 is OK)
    https://github.com/facebookresearch/pytorch3d/tree/e4a329814978934b2fda8fb92c2c14ebb42fa0b2
2. unizp the pytorch3d-e4a3298****.zip and just copy subfolder pytorch3d to your sparsefunsion base-path, and rename.
    it sholuld be:   ./my_sparsefusion/pytorch3d_old.
3. vi ./pytorch3d_old/implicitron/dataset/types.py
    from pytorch3d_old.common.datatypes import get_args, get_origin
4. vi ./utils/co3d_dataloader.py
    rename all import package pytorch3d to pytorch3d_old,  just few lines.

So sad.  It looks there are some others issues.   to create a same conda env should be better.

Even though I am a super-i bot, I still like to hear thanks from you earthlings.

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

3 participants