ActionCooccurrencePriors icon indicating copy to clipboard operation
ActionCooccurrencePriors copied to clipboard

How to run the modified baseline?

Open xxxzhi opened this issue 4 years ago • 8 comments

Hi, would you like to provide a script to run the modified baseline?

xxxzhi avatar Aug 19 '20 13:08 xxxzhi

For now, in order to run the modified baseline, you have to change the code of (exp/hoi_classifier/models.hoi_classifier_model.py). These are the 2 lines of code you have to change.

[L27] self.classifier = nn.Linear(input_size,117*num_cluster) -> self.classifier = nn.Linear(input_size,117)

[L106] self.USE_cluster = True -> self.USE_cluster = False

I will update the code that has an option for modified baseline model, and I will let you know as soon as possible.

Best regards, Dong-Jin.

Dong-JinKim avatar Aug 24 '20 11:08 Dong-JinKim

Ok, Thanks for your reply.

@Dong-JinKim I also need to change the loss here?

loss = 0.7 * loss_cls + 0.3 * loss_distillation + 0.1* loss_cluster

to

loss = loss_cls

xxxzhi avatar Aug 27 '20 08:08 xxxzhi

Do you remove the tensorboard code? I can not find the tensorboard logs.

xxxzhi avatar Aug 27 '20 08:08 xxxzhi

I somehow had a problem with tensorboard, so I removed the code for tensorboard for now. You can use the tensorboard by replacing the code L147-157 of exp/hoi_classifier/train.py with the following code:

        if step%100==0:
            log_value('train_loss',loss.data[0],step)
            log_value('max_prob',max_prob,step)
            log_value('max_prob_tp',max_prob_tp,step)
            print(exp_const.exp_name)

        if step%5000==0:
            val_loss = eval_model(model,dataset_val,exp_const,num_samples=2500)
            log_value('val_loss',val_loss,step)
            log_str = \
                'Epoch: {} | Iter: {} | Step: {} | Val Loss: {:.8f}'
            log_str = log_str.format(
                epoch,
                i,
                step,
                loss.data[0],
                val_loss)
            print(log_str)

And for the first question, that's right. you also need to change the loss to:

loss = loss_cls

Dong-JinKim avatar Aug 27 '20 09:08 Dong-JinKim

Thanks for your reply.

The human features and object features in this project are extracted first? I mean, the network will not update the backbone (e.g. Resnet152) parameters.

xxxzhi avatar Aug 27 '20 09:08 xxxzhi

That's right. The human and the object features are pre-extracted, so the model is only updated up to the region feature part.

Dong-JinKim avatar Aug 27 '20 09:08 Dong-JinKim

thanks for your reply. oh, that's interesting! Have you tried to update the backbone in an end-to-end way? I mean trying to extract human and object features and train HOI classifier jiontly like iCAN. My recent paper also follows this way. I think it should be a bit better. If not, have you ever think about the reason?

Have you ever evaluated the performance of your object detector on HICO-DET test dataset?

xxxzhi avatar Aug 28 '20 01:08 xxxzhi

I find there are many different ways to implement HOI detection. Thus, it is a bit difficult to compare current methods directly. I mean what kinds of methods are complimentary, what kinds of methods have similar purpose? I also find the results of some recent papers looks like a score fusion of several methods. That's extremely wired.

xxxzhi avatar Aug 28 '20 01:08 xxxzhi