pytorch / tvm

TVM integration into PyTorch
449 stars 64 forks source link

error when importing torch_tvm #128

Closed lixiuhong closed 4 years ago

lixiuhong commented 4 years ago

I have installed pytorch 1.4.0a0 from source, and pytorch_tvm with the command "SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")" but it still failed, when i import torch_tvm.

This is the error information:

import torch print(torch.version) 1.4.0a0+1f158ad import torch_tvm Traceback (most recent call last):

File "", line 1, in

File "/home/lixiuhong/anaconda3/envs/pytorch_tvm/lib/python3.7/site-packages/torch_tvm/init.py", line 9, in from ._torch_tvm import *

ImportError: /home/lixiuhong/anaconda3/envs/pytorch_tvm/lib/python3.7/site-packages/torch_tvm/_torch_tvm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3tvm5relay2Op3GetERKSs

jwfromm commented 4 years ago

Have you figured out the solution this error? I'm also encountering it.

lixiuhong commented 4 years ago

Have you figured out the solution this error? I'm also encountering it.

Not yet. So sad......

VincentChong123 commented 4 years ago

Same issue here, will try install pytorch from source

from ._torch_tvm import *

ImportError: ... torch_tvm/_torch_tvm.cpython-35m-x86_64-linux-gnu.so: undefined symbol: 

_ZNK3tvm7runtime11TVMRetValue9AsNodeRefINS_3MapISsNS_5ArrayINS_11LoweredFuncEvEEvvEEEET_v
unsuccessful attempts
SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
#SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1") 
Python 3.5.7 
ubuntu18.05
torch '1.4.0.dev20191025+cpu'
gcc7.4
yinghai commented 4 years ago

Yeah, I think it's the CXX11 ABI issue.

hemantranvir commented 4 years ago

@LiXiuhong
I found this procedure helpful: https://circleci.com/gh/pytorch/tvm/674

Make sure you are using llvm-8

lixiuhong commented 4 years ago

@LiXiuhong I found this procedure helpful: https://circleci.com/gh/pytorch/tvm/674

Make sure you are using llvm-8

It works. Thanks