sparsefusion icon indicating copy to clipboard operation
sparsefusion copied to clipboard

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

Open georgeNakayama opened this issue 2 years ago • 2 comments

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!

georgeNakayama avatar Apr 16 '23 23:04 georgeNakayama

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!

zhizdev avatar Apr 18 '23 03:04 zhizdev

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.

yuedajiong avatar Jun 03 '23 08:06 yuedajiong