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

How to input image to generate scene graph? #121

Open
khizar-altaf opened this issue May 12, 2024 · 0 comments
Open

How to input image to generate scene graph? #121

khizar-altaf opened this issue May 12, 2024 · 0 comments

Comments

@khizar-altaf
Copy link

khizar-altaf commented May 12, 2024

Hello,
i have git clone graph.rcc.pytorch library for scene graph generation.kindly can anyone guide me how to input image to generate scene graph from this code ?I don't want to train.I want to use pretrained model sg_imp_step_ckpt.pth which i have downloaded sg_imp_step_ckpt.pth(511.3 MB) and placed it in a folder where main.py is located
But when I give command in Ubuntu terminal as follows:
~/GNN/graph-rcnn.pytorch$ python3 main.py --config-file configs/sgg_res101_step.yaml --inference --resume 99999 --algorithm graph-rcnn --visualize
then following error appears:

2024-05-15 21:31:52,262 scene_graph_generation INFO: Namespace(algorithm='graph-rcnn', batchsize=0, config_file='configs/sgg_res101_step.yaml', distributed=False, inference=True, instance=-1, local_rank=0, resume=99999, session=0, use_freq_prior=False, visualize=True)
2024-05-15 21:31:52,263 scene_graph_generation INFO: Loaded configuration file configs/sgg_res101_step.yaml
2024-05-15 21:31:52,263 scene_graph_generation INFO: Saving config into: logs/config.yml
Traceback (most recent call last):
File "main.py", line 92, in
main()
File "main.py", line 89, in main
test(cfg, args)
File "main.py", line 37, in test
model = build_model(cfg, arguments, args.local_rank, args.distributed)
File "/home/oem/GNN/graph-rcnn.pytorch/lib/model.py", line 307, in build_model
return SceneGraphGeneration(cfg, arguments, local_rank, distributed)
File "/home/oem/GNN/graph-rcnn.pytorch/lib/model.py", line 31, in init
self.data_loader_train = build_data_loader(cfg, split="train", is_distributed=distributed)
File "/home/oem/GNN/graph-rcnn.pytorch/lib/data/build.py", line 61, in build_data_loader
sampler = make_data_sampler(dataset, True if split == "train" else False, is_distributed)
File "/home/oem/GNN/graph-rcnn.pytorch/lib/data/build.py", line 15, in make_data_sampler
sampler = torch.utils.data.sampler.RandomSampler(dataset)
File "/home/oem/.local/lib/python3.8/site-packages/torch/utils/data/sampler.py", line 143, in init
raise ValueError(f"num_samples should be a positive integer value, but got num_samples={self.num_samples}")
ValueError: num_samples should be a positive integer value, but got num_samples=0

i am using mini_vg dataset

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

1 participant