facebookresearch / video-nonlocal-net

Non-local Neural Networks for Video Classification
Other
1.97k stars 325 forks source link

Some problem when building with the newest version of caffe2 #60

Open SunGaofeng opened 5 years ago

SunGaofeng commented 5 years ago

Thanks for providing us this wonderful repository. There is some problem when I want to run this code. (1) When I git clone the code of caffe2 forked by Xiaolong, there is some problem when download submodule codes such as eigen, and lead to a failure of cloning. (2) Then I try to down load the code of caffe2. Now caffe2 code is merged into pytorch. So I just git clone the pytorch code and build it. As others discussed in the issues, I copy and replace ./caffe2/video to the new code, modify USE_FFMPEG=ON in CMakelist, and fix the bug of inconsistence of protobuf version. However, building also failed and the error showed that Tensor is not a template. just as the following. I checked the source file of caffe2 forked by Xiaolong, Tensor is actually a Template defined in caffe2/core/tensor.h
template class Tensor {...} But in the newest version of pytorch, Tensor in caffe2 is defined in caffe2/core/tensor.h as
class CAFFE2_API Tensor final {...}. This mismatch will certainly lead to the problem.

============== Error information when build with the newest code of pytorch=========== In file included from /docker_mount/frameworks/pytorch/pytorch/caffe2/video/customized_video_input_op.cc:25:0: /docker_mount/frameworks/pytorch/pytorch/caffe2/video/customized_video_input_op.h:91:3: error: ‘caffe2::Tensor’ is not a template Tensor prefetched_clip_ondevice; ^ /docker_mount/frameworks/pytorch/pytorch/caffe2/video/customized_video_input_op.h:92:3: error: ‘caffe2::Tensor’ is not a template Tensor prefetched_label_ondevice;

SunGaofeng commented 5 years ago

So the problem now is that: (1) submodule can't be cloned when building with the caffe2 code forked by Xiaolong (2) mismatch of the caffe2_customized_ops/video code with the newest code of caffe2 in pytorch. Can you supply a complete version of code, including caffe2 as well as thirdparty ? Or a new version of caffe2_customized_ops/video which has no conflict with the newest version of caffe2? I've tried several days to rebuilt this excellent model and are really eager to get your help. Thanks.