lingvo icon indicating copy to clipboard operation
lingvo copied to clipboard

dlopen(lingvo/core/ops/x_ops.so, 6): image not found

Open zhayefei opened this issue 6 years ago • 3 comments

while exec the following code,

# Running this cell is equivalent to running the following command:
# (cpu) bazel run -c opt //lingvo:trainer -- --logtostderr --model=punctuator.codelab.RNMTModel --mode=sync --logdir=/tmp/punctuator --saver_max_to_keep=2 --run_locally=cpu
# (gpu) bazel run -c opt --config=cuda //lingvo:trainer -- --logtostderr --model=punctuator.codelab.RNMTModel --mode=sync --logdir=/tmp/punctuator --saver_max_to_keep=2 --run_locally=gpu

# Reset the kernel to make sure changes to the model params are re-registered.
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(restart=True)

# Start tensorboard (access at http://localhost:6006)
import os
os.system('lsof -t -i:6006 || tensorboard --logdir=/tmp/nqg &')

# Start the trainer
import tensorflow as tf
from lingvo import trainer
argv = [
  "trainer.py",
  "--model=nqg.train.RNMTModel",
  "--mode=sync",
  "--logdir=/tmp/nqg",
  "--saver_max_to_keep=2",
  "--run_locally=gpu",  # or cpu.
]
tf.app.run(trainer.main, argv=argv)

the error is

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
<ipython-input-1-4b9a3f22cd93> in <module>
      9 # Start the trainer
     10 import tensorflow as tf
---> 11 from lingvo import trainer
     12 argv = [
     13   "trainer.py",

5 frames
/code/lingvo/lingvo/core/ops/py_x_ops.py in <module>
     24 
     25 gen_x_ops = tf.load_op_library(
---> 26     tf.resource_loader.get_path_to_datafile('x_ops.so'))
     27 
     28 if 'assert_shape_match' not in dir(gen_x_ops):

~/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename)
     54     RuntimeError: when unable to load the library or get the python wrappers.
     55   """
---> 56   lib_handle = py_tf.TF_LoadLibrary(library_filename)
     57 
     58   op_list_str = py_tf.TF_GetOpList(lib_handle)

NotFoundError: dlopen(/code/lingvo/lingvo/core/ops/x_ops.so, 6): no suitable image found.  Did find:
	/code/lingvo/lingvo/core/ops/x_ops.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
	/code/lingvo/lingvo/core/ops/x_ops.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

any one knows how to fix it ?

zhayefei avatar Apr 28 '19 11:04 zhayefei

It looks like the problem is with the .so being compiled for ubuntu but trying to be loaded into osx. Did you start the colab kernel from inside of docker?

jonathanasdf avatar Apr 30 '19 20:04 jonathanasdf

It looks like the problem is with the .so being compiled for ubuntu but trying to be loaded into osx. Did you start the colab kernel from inside of docker?

Encountered the same problem. The question is because of docker? Do I have to use docker to build?

Fansgithub2019 avatar Sep 15 '19 08:09 Fansgithub2019

You don't have to use docker, but then it is up to you to get the correct environment configuration. If you're using a mac and not using docker we have not tested that setup and cannot give any advice regarding it.

jonathanasdf avatar Sep 16 '19 21:09 jonathanasdf