Hi, I am having some trouble exporting the ONNX operator Pow to Caffe2. ONNX claims that Pow supports broadcasting but it seems like Caffe2 doesn’t believe it.
Entire error message:
Original python traceback for operator 14 in network torch-jit-export_predict in exception above (most recent call last):
Traceback (most recent call last):
File “export.py”, line 64, in <module>
start = time.time()
File “/persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/onnx/backend_rep.py”, line 57, in run
self.workspace.RunNet(self.predict_net.name)
File “/persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/onnx/workspace.py”, line 63, in f
return getattr(workspace, attr)(*args, **kwargs)
File “/persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/workspace.py”, line 236, in RunNet
StringifyNetName(name), num_iter, allow_fail,
File “/persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/workspace.py”, line 197, in CallWithExceptionIntercept
return func(*args, **kwargs)
RuntimeError: [enforce fail at pow_op.h:99] A.sizes() == B.sizes(). [1, 128, 768] vs []. Dimension mismatch - did you forget to set broadcast=1?
Error from operator:
input: “220” input: “221” output: “222” name: “” type: “Pow” device_option { device_type: 1 device_id: 0 }frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const&, void const*) + 0x59 (0x7f199d05cd69 in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x29f03e7 (0x7f19a2bb83e7 in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/torch/lib/libcaffe2_gpu.so)
frame #2: <unknown function> + 0x144d1bd (0x7f19a16151bd in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/torch/lib/libcaffe2_gpu.so)
frame #3: caffe2::SimpleNet::Run() + 0x16d (0x7f199e6a2c9d in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/torch/lib/libcaffe2.so)
frame #4: caffe2::Workspace::RunNet(std::string const&) + 0x3a (0x7f199e6ddbca in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/torch/lib/libcaffe2.so)
frame #5: <unknown function> + 0x49a27 (0x7f1996933a27 in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/caffe2_pybind11_state_gpu.cpython-37m-x86_64-linux-gnu.so)
frame #6: <unknown function> + 0x89fa8 (0x7f1996973fa8 in /persist/anaconda3/envs/newtest/lib/python3.7/site-packages/caffe2/python/caffe2_pybind11_state_gpu.cpython-37m-x86_64-linux-gnu.so)
<omitting python frames>
frame #29: __libc_start_main + 0xf0 (0x7f19e1353830 in /lib/x86_64-linux-gnu/libc.so.6)