运行if name == "main":报错ImportError: libmklml_intel.so: cannot open shared object file: No such file or directory
pip安装的cpu版本,ubuntu系统,用jupyter notebook运行代码 `... class TestMNIST: def init(self): # 该模型运行在CUP上,CUP的数量为2 paddle.init(use_gpu=False, trainer_count=2)
# *****************获取训练器********************************
def get_trainer(self):
... if name == "main": testMNIST = TestMNIST() # 开始训练 testMNIST.start_trainer()`
报错:
ImportError Traceback (most recent call last)
/home/liul9/.local/lib/python2.7/site-packages/paddle/v2/init.pyc in init(**kwargs) 126 127 def init(**kwargs): --> 128 import py_paddle.swig_paddle as api 129 args = [] 130 args_dict = {}
/home/liul9/.local/lib/python2.7/site-packages/py_paddle/init.py in
/home/liul9/.local/lib/python2.7/site-packages/py_paddle/util.py in
/home/liul9/.local/lib/python2.7/site-packages/py_paddle/swig_paddle.py in
/home/liul9/.local/lib/python2.7/site-packages/py_paddle/swig_paddle.py in swig_import_helper() 22 if fp is not None: 23 try: ---> 24 _mod = imp.load_module('_swig_paddle', fp, pathname, description) 25 finally: 26 fp.close()
ImportError: libmklml_intel.so: cannot open shared object file: No such file or directory
请参考 FAQ,看你的路径应该是export LD_LIBRARY_PATH=/home/liul9/.local/lib:$LD_LIBRARY_PATH
在bashrc添加了export LD_LIBRARY_PATH=/home/liul9/.local/lib:$LD_LIBRARY_PATH 在终端中运行source .bashrc 重启jupyter notebook 依旧出错 @luotao1
重启系统后已解决谢谢 @luotao1