Skip to content

Issue building model.cc #82

Open
Open

Description

@terranceliu

Hi, I'm running into an issue with set_device_type. Any ideas please?

[ 7%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.cc.o
/home/tliu/Dev/caffe2_cpp_tutorial/src/caffe2/util/model.cc: In member function ‘void caffe2::ModelUtil::AddIterOps()’:
/home/tliu/Dev/caffe2_cpp_tutorial/src/caffe2/util/model.cc:81:28: error: no matching function for call to ‘caffe2::DeviceOption::set_device_type(const DeviceType&)’
->set_device_type(CPU);
^
In file included from /usr/include/caffe2/proto/caffe2_pb.h:4:0,
from /usr/include/caffe2/core/context_base.h:7,
from /usr/include/caffe2/core/context.h:10,
from /usr/include/caffe2/core/storage.h:14,
from /usr/include/caffe2/core/tensor.h:4,
from /usr/include/caffe2/core/blob.h:14,
from /usr/include/caffe2/core/net.h:13,
from /home/tliu/Dev/caffe2_cpp_tutorial/src/caffe2/util/external.pb.h:6,
from /home/tliu/Dev/caffe2_cpp_tutorial/src/caffe2/util/model.pb.h:34,
from /home/tliu/Dev/caffe2_cpp_tutorial/src/caffe2/util/model.cc:1:
/usr/include/caffe2/proto/caffe2.pb.h:4289:13: note: candidate: void caffe2::DeviceOption::set_device_type(google::protobuf::int32)
inline void DeviceOption::set_device_type(::google::protobuf::int32 value) {
^
/usr/include/caffe2/proto/caffe2.pb.h:4289:13: note: no known conversion for argument 1 from ‘const DeviceType {aka const at::DeviceType}’ to ‘google::protobuf::int32 {aka int}’

Activity

  1. jerryzh168 commented on Oct 25, 2018

    @jerryzh168

    we changed the proto name to PROTO_CPU to merge the DeviceType of pytorch and caffe2, so you'll need to use set_device_type(PROTO_CPU).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions