jwyang / graph-rcnn.pytorch

[ECCV 2018] Official code for "Graph R-CNN for Scene Graph Generation"
733 stars 157 forks source link

How to evaluate pretrained model (application) #114

Open DorianMood opened 3 years ago

DorianMood commented 3 years ago

I will be grateful to know is there any option to use a pretrained model.

Since the main.py file doesn't have any code that loads the model from a checkpoint and the README.md doesn't have any information on it either.

It is not really clear how do I use provided checkpoints. Usually, the type of model is torch.nn.Model, so I can do it like this:

model = build_model(cfg, arguments, args.local_rank, args.distributed)
state_dict = torch.load("/content/visual-genome/checkpoints/faster_rcnn_ckpt.pth", map_location="cpu")
model.load_state_dict(state_dict)

But here the type of SceneGraphGeneration is not even a PyTorch model.

I will be happy to know is there any way to use this in a real project.