fredzzhang / upt

[CVPR'22] Official PyTorch implementation for paper "Efficient Two-Stage Detection of Human–Object Interactions with a Novel Unary–Pairwise Transformer"
https://fredzzhang.com/unary-pairwise-transformers
BSD 3-Clause "New" or "Revised" License
150 stars 24 forks source link

Here is problem #44

Closed ghzmwhdk777 closed 2 years ago

ghzmwhdk777 commented 2 years ago

Traceback (most recent call last): File "inference.py", line 225, in main(args) File "C:\Users\User\anaconda3\envs\colab\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "inference.py", line 150, in main upt = build_detector(args, conversion) File "C:\Users\User\PycharmProjects\hoi\UPT\upt.py", line 268, in builddetector detr, , postprocessors = build_model(args) File "C:\Users\User\PycharmProjects\hoi\UPT\detr\models__init__.py", line 6, in build_model return build(args) File "C:\Users\User\PycharmProjects\hoi\UPT\detr\models\detr.py", line 313, in build num_classes = 20 if args.dataset_file != 'coco' else 91 AttributeError: 'Namespace' object has no attribute 'dataset_file'

ghzmwhdk777 commented 2 years ago

A lot of modifications were needed for the reference of this code to work. And I solved most of the problems. But the problem still remains.

Traceback (most recent call last): File "inference.py", line 225, in main(args) File "C:\Users\User\anaconda3\envs\colab\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "inference.py", line 150, in main upt = build_detector(args, conversion) File "C:\Users\User\PycharmProjects\hoi\UPT\upt.py", line 276, in build_detector detr.backbone[0].num_channels, File "C:\Users\User\anaconda3\envs\colab\lib\site-packages\torch\nn\modules\module.py", line 1130, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'DETRsegm' object has no attribute 'backbone'

What the hell should I do with this? Is this also a problem for args?

ghzmwhdk777 commented 2 years ago

i really want run this project.

if you possible, give me "google colab version" please

fredzzhang commented 2 years ago

Hi @ghzmwhdk777,

Thanks for taking an interest in our work.

Assuming all libraries have been installed with the correct version, the code should work just fine. The last error message you posted traces back to pytorch modules, which suggest you might have installed a different version. Can you check you have installed PyTorch 1.9.0?

Fred.

ghzmwhdk777 commented 2 years ago

Yes, it's not a version issue. I'll try my best first and then ask you again. Thank you for your answer.