Converting pre-trained models from Caffe to PyTorch
Closed this issue · 2 comments
First of all, thanks for your LiteFlowNet reimplementation in PyTorch. I wonder how do you convert the pre-trained model to PyTorch?
Since I'm trying to convert this model from Caffe to PyTorch also, could you please explain the procedure, or maybe refer to a certain method that you used? That would be very helpful.
Regards
Thank you for your kind words and for being interested in this repository! I first examined the Caffe model defined in the prototxt. In doing so, I always find Netscope to be quite handy. All that was left to do then was to load the pre-trained Caffe weights in the PyTorch model. To do so, I used loadcaffe to load the Caffe weights and to store them as Torch weights. I was then finally able to use torchfile to load the Torch weights in PyTorch. There probably is a more direct approach though.
Thanks for your suggestion! The netscope visualizer is very helpful, however it returns an error when the LiteFlowNet model is imposed due to a non-DAG model:
uncaught exception: Graph is not a DAG.
How do you resolve this problem?