facebookresearch / TensorComprehensions

A domain specific language to express machine learning workloads.
https://facebookresearch.github.io/TensorComprehensions/
Apache License 2.0
1.76k stars 211 forks source link

[Build] undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv #241

Closed amirsani closed 6 years ago

amirsani commented 6 years ago

When submitting a bug report, please include the following information (where relevant):

In addition, including the following information will also be very helpful for us to diagnose the problem:

In [1]: import tensor_comprehensions as tc ``

~/anaconda3/lib/python3.6/site-packages/tensor_comprehensions/init.py in () 14 ############################################################################## 15 ---> 16 from tensor_comprehensions.tc_unit import decode 17 from tensor_comprehensions.tc_unit import define 18 from tensor_comprehensions.tc_unit import TcUnit

~/anaconda3/lib/python3.6/site-packages/tensor_comprehensions/tc_unit.py in () 19 from torch.autograd import Variable 20 ---> 21 from tensor_comprehensions.tc import ATenCompilationUnit 22 from tensor_comprehensions.tc import set_logtostderr, set_debug_lang, set_debug_halide, set_debug_tc_mapper, set_debug_cuda, set_debug_tuner, set_dump_cuda 23 from tensor_comprehensions.torch_tc.tc_function import TCFunction, unpack_variables, get_tensors, make_contiguous

ImportError: /home/amir/anaconda3/lib/python3.6/site-packages/tensor_comprehensions/../../../libtc_proto.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv ``

prigoyal commented 6 years ago

Hi @amirsani , thanks for the report. It looks like you are installing two pytorch: in the first install with TC, pytorch with cuda8 is getting installed. Then it looks like pytorch with cuda9 was also installed separately. Can you try the following commands exactly in the order and let me know if you see the error:

conda create -y --name tc-env python=3.6
source activate tc-env
conda install -c pytorch -c tensorcomp tensor_comprehensions

also, can you tell me output of

which python

and

which ipython

and then the output of

import torch
print(torch)
amirsani commented 6 years ago

Hi Priya,

Apologies for the delay. I've been away.

Here is the output for which python: /home/amir/anaconda3/envs/tc-env/bin/python and which ipython: /home/amir/anaconda3/bin/ipython and the ouput from running ipython:

Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 18:21:58) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.

and the output for importing torch:

In [1]: import torch
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-eb42ca6e4af3> in <module>()
----> 1 import torch

~/anaconda3/lib/python3.6/site-packages/torch/__init__.py in <module>()
     54 except ImportError:
     55     pass
---> 56 from torch._C import *
     57 
     58 __all__ += [name for name in dir(_C)

ImportError: /home/amir/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: THSShortTensor_zerosLike

Thank you for your help,

Amir

prigoyal commented 6 years ago

thanks @amirsani , from the output of the which ipython it looks like your ipython is not the one in tc-env and hence it is failing to detect pytorch or tc installs.

can you conda install ipython in your tc-env conda env and try again?

Thanks a lot :)

amirsani commented 6 years ago

Hi Priya,

It worked!!!! Thank you!! Thank you!! Thank you!! :)))

For reference, here is what I got when running ipython: `` Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 18:21:58) Type 'copyright', 'credits' or 'license' for more information IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import torch

In [2]: print(torch) <module 'torch' from '/home/amir/anaconda3/envs/tc-env/lib/python3.6/site-packages/torch/init.py'> ``

prigoyal commented 6 years ago

great to hear @amirsani . I'll close out this issue then. Please feel free to reach out to us for any future questions :)