microsoft / MaskFlownet

[CVPR 2020, Oral] MaskFlownet: Asymmetric Feature Matching with Learnable Occlusion Mask

Home Page:https://arxiv.org/abs/2003.10955

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use inference with my own dataset?

vestri opened this issue · comments

Hi, thanks for sharing.
I am trying to test your model on a pair of image but could not make it working.
I installed Python 3.6.10 and mxnet1.5 using anaconda and all necessary modules.
By now it crashes when reading the model, something is missing. Here is my command:
python main.py MaskFlownet_S.yaml -c 8caNov12 --predict --clear_steps --debug
and result is:
[('C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\logs\8caNov12-1532.log', '8caNov12-1532', '-1532')]
Default FLAGS..network.flow_multiplier to 1.0
Default FLAGS..network.deform_bias to True
Default FLAGS..network.upfeat_ch to [16, 16, 16, 16]
Default FLAGS..network.mw to [0.005, 0.01, 0.02, 0.08, 0.32]
Default FLAGS..optimizer.q to None
Default FLAGS..optimizer.learning_rate to None
Load Checkpoint C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\weights\8caNov12-1532_300000.params
load the weight for the network
Traceback (most recent call last):
File "main.py", line 136, in
pipe.load(checkpoint)
File "C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\network\pipeline.py", line 57, in load
self.network.load_parameters(checkpoint, ctx=self.ctx)
File "C:\Users\cvestri\AppData\Local\conda\conda\envs\py36_mxnet\lib\site-packages\mxnet\gluon\block.py", line 394, in load_parameters
cast_dtype=cast_dtype, dtype_source=dtype_source)
File "C:\Users\cvestri\AppData\Local\conda\conda\envs\py36_mxnet\lib\site-packages\mxnet\gluon\parameter.py", line 968, in load
name[lprefix:], filename, _brief_print_list(arg_dict.keys()))
AssertionError: Parameter 'hybridsequential0_conv1aweight' is missing in file 'C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\weights\8caNov12-1532_300000.params', which contains parameters: 'maskflownet_s0_maskflownet_s0_hybridsequential0_conv1aweight', 'maskflownet_s0_maskflownet_s0_hybridsequential0_conv1abias', 'maskflownet_s0_maskflownet_s0_hybridsequential1_conv1bweight', ..., 'maskflownet_s0_deform3weight', 'maskflownet_s0_deform3bias', 'maskflownet_s0_deform2weight', 'maskflownet_s0_deform2bias'. Please make sure source and target networks have the same prefix.

it is the same with mxNet 1.6
Thanks

I have complete this requirement, but the calculated flow visualization was wrong (the flow I calculated with Flownet2 using the official suggested visualization code was correct). After I solve this problem, I can upload a copy of my code in a few days.

Hi, thanks for sharing.
I am trying to test your model on a pair of image but could not make it working.
I installed Python 3.6.10 and mxnet1.5 using anaconda and all necessary modules.
By now it crashes when reading the model, something is missing. Here is my command:
python main.py MaskFlownet_S.yaml -c 8caNov12 --predict --clear_steps --debug
and result is:
[('C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\logs\8caNov12-1532.log', '8caNov12-1532', '-1532')]
Default FLAGS..network.flow_multiplier to 1.0
Default FLAGS..network.deform_bias to True
Default FLAGS..network.upfeat_ch to [16, 16, 16, 16]
Default FLAGS..network.mw to [0.005, 0.01, 0.02, 0.08, 0.32]
Default FLAGS..optimizer.q to None
Default FLAGS..optimizer.learning_rate to None
Load Checkpoint C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\weights\8caNov12-1532_300000.params
load the weight for the network
Traceback (most recent call last):
File "main.py", line 136, in
pipe.load(checkpoint)
File "C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\network\pipeline.py", line 57, in load
self.network.load_parameters(checkpoint, ctx=self.ctx)
File "C:\Users\cvestri\AppData\Local\conda\conda\envs\py36_mxnet\lib\site-packages\mxnet\gluon\block.py", line 394, in load_parameters
cast_dtype=cast_dtype, dtype_source=dtype_source)
File "C:\Users\cvestri\AppData\Local\conda\conda\envs\py36_mxnet\lib\site-packages\mxnet\gluon\parameter.py", line 968, in load
name[lprefix:], filename, _brief_print_list(arg_dict.keys()))
AssertionError: Parameter 'hybridsequential0_conv1aweight' is missing in file 'C:\Users\cvestri\Work\Dev\RDVision\Code\MaskFlownet\weights\8caNov12-1532_300000.params', which contains parameters: 'maskflownet_s0_maskflownet_s0_hybridsequential0_conv1aweight', 'maskflownet_s0_maskflownet_s0_hybridsequential0_conv1abias', 'maskflownet_s0_maskflownet_s0_hybridsequential1_conv1bweight', ..., 'maskflownet_s0_deform3weight', 'maskflownet_s0_deform3bias', 'maskflownet_s0_deform2weight', 'maskflownet_s0_deform2bias'. Please make sure source and target networks have the same prefix.

it is the same with mxNet 1.6
Thanks

I have complete this requirement, but the calculated flow visualization was wrong (the flow I calculated with Flownet2 using the official suggested visualization code was correct). After I solve this problem, I can upload a copy of my code in a few days.

@vestri Hi, thanks for your interest.

I met similar errors before, but they are due to the incorrect prefix of weight parameters. Have you tried other weights? Is 8ca the only one leading to this error?

@vestri I think it should be MaskFlownet.yaml instead of MaskFlownet_S.yaml, if you are using pretrained weights 8caNov12. If you would like to run MaskFlownet_S.yaml, please use pretrained weights abbSep15 or dbbSep30 instead.

@vestri I think it should be MaskFlownet.yaml instead of MaskFlownet_S.yaml, if you are using pretrained weights 8caNov12. If you would like to run MaskFlownet_S.yaml, please use pretrained weights abbSep15 or dbbSep30 instead.

Hello, thank you very much for your excellent work. I complete the optical flow extraction of the custom dataset based on MaskFlownet, and obtained the optical flow file. However, and there was a mistake when I used the visualization code to visualize the optical flow file obtained from the previous step. Would you like to release your code of flow map visualization to help me identify where the errors occurred (I refer to sintel.py to complete my experiment)? Thank you very much.

  1. FlowNet2 + visulization code
    image

  2. MaskFlowNet2 + visulization code
    image

my visulization code comes from here: https://github.com/tomrunia/OpticalFlow_Visualization, it works well with FlowNet2