Repository: pytorch
Issue: RuntimeError:[enforce fail at context.h:48] option.device_type() ==PROTO_CPU. 1vs0
Labels: caffe2,triaged


Traceback (most recent call last):
File "/usr/VMZ-master-1/tools/train_net.py", line 586, in
main()
File "/usr/VMZ-master-1/tools/train_net.py", line 581, in main
Train(args)
File "/usr/VMZ-master-1/tools/train_net.py", line 404, in Train
workspace.CreateNet(test_model.net)
File "/root/pytorch/build/caffe2/python/workspace.py", line 181, in CreateNet
StringifyProto(net), overwrite,
File "/root/pytorch/build/caffe2/python/workspace.py", line 215, in CallWithExceptionIntercept
return func(args, kwargs)
RuntimeError: [enforce fail at context.h:48] option.device_type() == PROTO_CPU. 1 vs 0
frame #0: c10::ThrowEnforceNotMet(char const, int, char const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, void const) + 0x78 (0x7fed19c32178 in /usr/local/lib/libc10.so)
frame #1: + 0x2686d70 (0x7fecdcf03d70 in /usr/local/lib/libtorch.so)
frame #2: + 0x2723fec (0x7fecdcfa0fec in /usr/local/lib/libtorch.so)
frame #3: + 0x3aff5ee (0x7fecde37c5ee in /usr/local/lib/libtorch.so)
frame #4: std::_Function_handler<std::unique_ptr<caffe2::OperatorBase, std::default_deletecaffe2::OperatorBase > (caffe2::OperatorDef const&, caffe2::Workspace*), std::unique_ptr<caffe2::OperatorBase, std::default_deletecaffe2::OperatorBase > ()(caffe2::OperatorDef const&, caffe2::Workspace)>::_M_invoke(std::_Any_data const&, caffe2::OperatorDef const&, caffe2::Workspace*&&) + 0x23 (0x7fed1a4b5433 in /root/pytorch/build/caffe2/python/caffe2_pybind11_state_gpu.so)
frame #5: + 0x236c25c (0x7fecdcbe925c in /usr/local/lib/libtorch.so)
frame #6: caffe2::CreateOperator(caffe2::OperatorDef const&, caffe2::Workspace*, int) + 0x328 (0x7fecdcbea528 in /usr/local/lib/libtorch.so)
frame #7: caffe2::dag_utils::prepareOperatorNodes(std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*) + 0x2ad (0x7fecdcbda06d in /usr/local/lib/libtorch.so)
frame #8: caffe2::AsyncNetBase::AsyncNetBase(std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*) + 0x24d (0x7fecdcbb670d in /usr/local/lib/libtorch.so)
frame #9: caffe2::AsyncSchedulingNet::AsyncSchedulingNet(std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*) + 0x9 (0x7fecdcbbb5b9 in /usr/local/lib/libtorch.so)
frame #10: + 0x23410ae (0x7fecdcbbe0ae in /usr/local/lib/libtorch.so)
frame #11: std::_Function_handler<std::unique_ptr<caffe2::NetBase, std::default_deletecaffe2::NetBase > (std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*), std::unique_ptr<caffe2::NetBase, std::default_deletecaffe2::NetBase > ()(std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace)>::_M_invoke(std::_Any_data const&, std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*&&) + 0x23 (0x7fecdcbbdf83 in /usr/local/lib/libtorch.so)
frame #12: caffe2::CreateNet(std::shared_ptr<caffe2::NetDef const> const&, caffe2::Workspace*) + 0x4a5 (0x7fecdcbb0495 in /usr/local/lib/libtorch.so)
frame #13: caffe2::Workspace::CreateNet(std::shared_ptr<caffe2::NetDef const> const&, bool) + 0x103 (0x7fecdcc2fe23 in /usr/local/lib/libtorch.so)
frame #14: caffe2::Workspace::CreateNet(caffe2::NetDef const&, bool) + 0x91 (0x7fecdcc30d61 in /usr/local/lib/libtorch.so)
frame #15: + 0x57906 (0x7fed1a4ad906 in /root/pytorch/build/caffe2/python/caffe2_pybind11_state_gpu.so)
frame #16: + 0x57bd2 (0x7fed1a4adbd2 in /root/pytorch/build/caffe2/python/caffe2_pybind11_state_gpu.so)
frame #17: + 0x99e3d (0x7fed1a4efe3d in /root/pytorch/build/caffe2/python/caffe2_pybind11_state_gpu.so)

frame #33: __libc_start_main + 0xe7 (0x7fed1e897b97 in /lib/x86_64-linux-gnu/libc.so.6)