I compiled pytorch in ubuntu. I followed these steps to install Caffe2:

cd pytorch
mkdir release && cd release
cmake …
make -j8
sudo make install

Qt Creator .pro file:
INCLUDEPATH + = / usr / local / include / caffe2
LIBS + = -L / usr / local / lib -lcaffe2_detectron_ops_gpu -lcaffe2_nvrtc -lcaffe2_observers
INCLUDEPATH + = / usr / local / include / google / protobuf
LIBS + = -L / usr / local / lib -lprotobuf
Following code
main.cpp file:
#include <caffe2 / core / blob.h>
#incude <google / protobuf / any.h>
Bugs: no matching function for call to ‘google :: protobuf :: internal: InternalMetadata :: unknown_fields’ or’ google :: protobuf :: internal ‘does not name a type’
Any ideas? I am happy to provide any more details or share the project.
Thanks,