GriffinLiang / vrd-dsr

Code for Visual Relationship Detection with Deep Structural Ranking (AAAI2018)
121 stars 32 forks source link

Question on requires_grad #8

Closed yangshao closed 6 years ago

yangshao commented 6 years ago

Hi, I'm trying to run this code on my own data, but i don't understand why do you set the object classification layer's requires_grad as False? network.set_trainable(self.fc_obj, requires_grad=False)

GriffinLiang commented 6 years ago

Because I use proposal.pkl to acquire the object classification confidence. You can change it if you need.

yangshao commented 6 years ago

@GriffinLiang So this layer(self.fc_obj) is only used in the relation testing instead of training?

yangshao commented 6 years ago

@GriffinLiang when I try to also train the objects label at the same time, the training loss doesn't decrease anymore. The only change i do is set fc_obj's requires_grad = True and set the loss as object classification cross entropy loss. Have you ever tried training object labels? Thanks.

yangshao commented 6 years ago

I figured out the reason: i need to add new layers to opt_params...