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

Inference for a new image with the pretrained model #114

Open
Shiying99 opened this issue May 10, 2024 · 1 comment
Open

Inference for a new image with the pretrained model #114

Shiying99 opened this issue May 10, 2024 · 1 comment

Comments

@Shiying99
Copy link

Shiying99 commented May 10, 2024

Hello,

Thank you for the amazing work. I am new here and would like to test some pretrained model for scene graph generation like the DEMO using my laptop. It is a windows laptop and was successfully installed all the necessary packages using conda and pip and the datasets.

However, I don't have slurm on my machine. So I wonder if it is possible to run the inference model with config file on the windows machine to recreate the same output as the Demo API.

Few questions:

  1. Where can I change the input dataset for inferencing instead of using the preset one?

  2. When I run following command direct on the terminal without slurm, I got an error from mmdet packge, how to solve it:
    python tools/test.py configs/psgtr/psgtr_r50_psg.py work_dirs/psgtr_r50_e60/epoch_60.pth --out work_dirs/psgtr_r50_e60/epoch_60_extra.pkl --show-dir work_dirs/psgtr_r50_e60

creating index...
index created!
load checkpoint from local path: work_dirs/psgtr_r50_e60/epoch_60.pth
[ ] 0/2177, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/test.py", line 244, in
main()
File "tools/test.py", line 207, in main
outputs = single_gpu_test(model, data_loader, args.show, args.show_dir,
File "C:\Users\ShiyingLi\anaconda3\envs\mmdet\lib\site-packages\mmdet\apis\test.py", line 52, in single_gpu_test
model.module.show_result(
File "C:\Users\ShiyingLi\anaconda3\envs\mmdet\lib\site-packages\mmdet\models\detectors\base.py", line 320, in show_result
bboxes = np.vstack(bbox_result)
File "<array_function internals>", line 200, in vstack
File "C:\Users\ShiyingLi\anaconda3\envs\mmdet\lib\site-packages\numpy\core\shape_base.py", line 293, in vstack
arrs = atleast_2d(*tup)
File "<array_function internals>", line 200, in atleast_2d
File "C:\Users\ShiyingLi\anaconda3\envs\mmdet\lib\site-packages\numpy\core\shape_base.py", line 121, in atleast_2d
ary = asanyarray(ary)
ValueError: setting an array element with a sequence. The requested array would exceed the maximum number of dimension of 32.

@chenxwh @Jingkang50

Really appreciate if you reply to the questions. Thank you so much.

@Jingkang50
Copy link
Owner

Jingkang50 commented May 12, 2024

Thank you for your interest in our project!
I assume the error comes from some version issue? Does your cuda and mmdet version match our readme requirement?

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

2 participants