NVIDIA / flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
Other
3.14k stars 741 forks source link

forward() takes exactly 2 arguments (3 given) #6

Closed PkuRainBow closed 6 years ago

PkuRainBow commented 6 years ago

The error information is like this:

TypeError: forward() takes exactly 2 arguments (3 given)

image

Besides I am wondering about one line(line #142) code in the main.py

flownets2_flow2 = self.flownets_2(concat2, '2')[0]

What does '2' represent?

foolwood commented 6 years ago

Fix in this line.https://github.com/NVIDIA/flownet2-pytorch/blob/fdf3166d06b800b13d224d73de978f5e48e6d91f/models.py#L142

flownets2_flow2 = self.flownets_2(concat2, '2')[0] -> flownets2_flow2 = self.flownets_2(concat2)[0]

BTW, the author can also fix this line. https://github.com/NVIDIA/flownet2-pytorch/blob/fdf3166d06b800b13d224d73de978f5e48e6d91f/models.py#L249

def forward(self, x, ntk_num='1'): -> def forward(self, inputs, ntk_num='1'):

Some similar spelling errors should be fixed.

PkuRainBow commented 6 years ago

@foolwood Thanks, however I find that the EPE error does not converge when I train the model on FlyingChairs. The EPE is increasing after some epochs.

foolwood commented 6 years ago

@PkuRainBow I meet the same problem. So I first train the flownet2c with a learning rate of 1e-6 for 2000 epoches in MPI-Sintel. But when I back the lr to 1e-4. The EPE error explodes again.

fitsumreda commented 6 years ago

depricated arguments for lines such as these flownets2_flow2 = self.flownets_2(concat2, '2')[0] have been removed now.