braindeadpool / bf-vos

Pytorch implementation of Blazingly Fast Video Object Segmentation with Pixel-Wise Metric Learning (Chen et al)
27 stars 6 forks source link

Online retrieval throws an exception #4

Open hanrelan opened 6 years ago

hanrelan commented 6 years ago

When running the online retrieval, I see the following error (truncated for brevity):

DEBUG:__main__:Model initialized and moved to CUDA
INFO:__main__:Loaded weights from ./bfvos/training/checkpoints/ckpt_epoch_1_batch_1800.pth
  File "./bfvos/retrieve.py", line 62, in batch_segment
    batch_embeddings = model(current_batch_tensor)
  File "anaconda3/envs/bf-vos/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'y'

I believe this is because the y parameter (3 channel tensor with (i, j, t)) isn't being passed to the network during online retrieval. Any advice on how to fix this?

Thanks

UniLauX commented 6 years ago

same question~ looking for the reply, thanks~

emedinac commented 5 years ago

I had the same problem. Using this conf:

run retrieve.py 'Database/DAVIS/DAVIS_480/JPEGImages/480p/train/' 'Database/DAVIS/DAVIS_480/JPEGImages/480p/train/00000.jpg' 'Database/DAVIS/DAVIS_480/Annotations/480p/train/00000.png' --model-path='model/epoch_1_1543137729_6983747.model' --verbose

marcelo-mendonca commented 5 years ago

This problem is because the code is still incomplete. For each frame, "y" is supposed to be a 3-channel matrix where width and height are (frame dimensions/8), the first two channels contain the pixel's x and y coordinates, respectively, and the last channel is filled with the frame number in all pixels positions.

I got it to work by creating a function to generate "y" the same way as in davis.py > DavisDataset > getitem.

zlai0 commented 4 years ago

@marcelo-mendonca Could you produce good results after fixing the issue?

marcelo-mendonca commented 4 years ago

@zlai0 I've trained it for only a few epochs and the results are not so brilliant.