成功地跟踪说明并从轮子安装了Apache Singa v1.0.0,但未能在下面运行,
(singa) $ pip list | grep singa
singa (1.0.0)
(singa) $ python
> import singa
> ImportError: No module named '_singa_wrap'
(singa) $ find -name "*singa_wrap*"
singa_wrap.py
singa_wrap.pyc
_singa_wrap.so似乎和Swig模块扩展有什么可疑的。有什么建议吗?
@编辑
验证protobuf 2.6.1已经在下面的全局安装,
(singa) $ python -c "from singa import _singa_wrap"
undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv
$ ldd _singa_wrap.so
libprotobuf.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
$ dpkg -S libprotobuf.so.9
libprotobuf9v5
$ apt-cache policy libprotobuf9v5
Installed: 2.6.1-1.3@解决方案
Singa在protobuf 2.6.1成功安装在下面的Ubuntu 16.04上后,现在开始跳舞,
$ sudo apt-get install python-pip # gcc-5 required thus installed
$ sudo apt-get install gcc-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
$ sudo update-alternatives --config gcc # to choose gcc-4.8剩下的跟着下面的答案@Wei。再次感谢。
发布于 2016-10-15 11:08:55
我想您可以尝试一下第一个常见问题http://singa.apache.org/en/docs/installation.html#faq中的方法。
此外,您还可以检查_singa_wrap.so的依赖库(转到/Python2.7/site/singa/和ldd _singa_wrap.so )。如果没有找到任何库(例如cudnn或protobuf),请尝试安装它或导出库路径。
有一张你的发行票,https://issues.apache.org/jira/browse/SINGA-255。
一旦完成就会更新你。
谢谢。
更新:
您的错误似乎与protobuf有关(可能是由计算机上的protobuf的多个版本引起的)。这是解决办法,
pip uninstall singapip install <path to the wheel file>https://stackoverflow.com/questions/39477252
复制相似问题