Raspberry Pi上的Inception Model mxnet:修复未知的激活类型错误?

时间:2018-08-27 19:40:30

标签: python raspberry-pi mxnet activation-function

我试图使用mxnet在Raspberry Pi上实现Inception模型,并得到一个我无法解开的错误:“未知激活类型”。

我成功安装了opencv,mxnet和所有依赖项。我正在运行一个简短的python script,该行在第19行从inception_predict调用一个函数,而该函数又从mxnet调用(第74行)一个预测函数(正向传播)。然后,Mxnet引用一个名为activation-in.h的文件,如果找不到您发送的激活类型(例如Relu,Tanh等),则第149行上存在致命的最后错误。

我查看了模型中的各层(可视化here),所有激活功能似乎都是Relu,我认为它可以正常工作。

我想念一些简单的事情吗?

[16:49:22] /usr/bin/incubator-mxnet/src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v0.8.0. Attempting to upgrade...
[16:49:22] /usr/bin/incubator-mxnet/src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
/usr/bin/incubator-mxnet/python/mxnet/module/base_module.py:67: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])
  warnings.warn(msg)
Capturing
Predicting
pre-processed image in 0.22853398323059082
Traceback (most recent call last):
  File "camera_test.py", line 19, in <module>
    topn = inception_predict.predict_from_local_file(filename, N=5)
  File "/home/pi/inception_predict.py", line 74, in predict_from_local_file
    return predict(filename, mod, synsets, N)
  File "/home/pi/inception_predict.py", line 48, in predict
    prob = mod.get_outputs()[0].asnumpy()
  File "/usr/bin/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 1972, in asnumpy
    ctypes.c_size_t(data.size)))
  File "/usr/bin/incubator-mxnet/python/mxnet/base.py", line 252, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [16:49:24] /usr/bin/incubator-mxnet/src/operator/nn/./activation-inl.h:149: unknown activation type

Stack trace returned 9 entries:
[bt] (0) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(dmlc::StackTrace[abi:cxx11]()+0x38) [0x6ed769e0]
[bt] (1) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x30) [0x6ed77134]
[bt] (2) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(void mxnet::op::ActivationCompute<mshadow::cpu>(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)+0x288) [0x6f19e0ac]
[bt] (3) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(mxnet::exec::FComputeExecutor::Run(mxnet::RunContext, bool)+0x68) [0x6ee3de84]
[bt] (4) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(+0x4bef54) [0x6ee44f54]
[bt] (5) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(mxnet::engine::ThreadedEngine::ExecuteOprBlock(mxnet::RunContext, mxnet::engine::OprBlock*)+0x3ec) [0x6ee2a800]
[bt] (6) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(std::_Function_handler<void (std::shared_ptr<dmlc::ManualEvent>), mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::{lambda()#1}::operator()() const::{lambda(std::shared_ptr<dmlc::ManualEvent>)#1}>::_M_invoke(std::_Any_data const&, std::shared_ptr<dmlc::ManualEvent>&&)+0xd4) [0x6ee2b0a0]
[bt] (7) /usr/bin/incubator-mxnet/python/mxnet/../../build/libmxnet.so(std::thread::_State_impl<std::_Bind_simple<std::function<void (std::shared_ptr<dmlc::ManualEvent>)> (std::shared_ptr<dmlc::ManualEvent>)> >::_M_run()+0x38) [0x6ee2ad28]
[bt] (8) /usr/lib/arm-linux-gnueabihf/libstdc++.so.6(+0x9c9dc) [0x6e1fb9dc]

关于名称匹配的警告也预先警告如下,但这似乎并不致命,甚至不一定与无法识别的激活功能有关:

  /usr/bin/incubator-mxnet/python/mxnet/module/base_module.py:67: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])

0 个答案:

没有答案