models icon indicating copy to clipboard operation
models copied to clipboard

Install the SyntaxNet and DRAGNN Python modules fails on macOS

Open kiril-me opened this issue 9 years ago • 10 comments

After successful execution of: bazel test --linkopt=-headerpad_max_install_names
dragnn/... syntaxnet/... util/utf8/...

I try to build python modules: bazel-bin/dragnn/tools/build_pip_package --output-dir=/tmp/syntaxnet_pkg

Got following error: cp: illegal option -- - usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory Traceback (most recent call last): File "/Users/kiril/Workspace/ml/models/syntaxnet/bazel-bin/dragnn/tools/build_pip_package.runfiles/main/dragnn/tools/build_pip_package.py", line 86, in main() File "/Users/kiril/Workspace/ml/models/syntaxnet/bazel-bin/dragnn/tools/build_pip_package.runfiles/main/dragnn/tools/build_pip_package.py", line 68, in main base_dir, "syntaxnet"), tmp_packaging File "/Users/kiril/anaconda/envs/dato-env/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cp', '-r', '--no-preserve=all', '/Users/kiril/Workspace/ml/models/syntaxnet/bazel-bin/dragnn/tools/build_pip_package.runfiles/main/dragnn', '/Users/kiril/Workspace/ml/models/syntaxnet/bazel-bin/dragnn/tools/build_pip_package.runfiles/main/syntaxnet', '/var/folders/y0/3pbnxldj2_xchyjm7p5r38rw0000gn/T/tmpFXrYNS']' returned non-zero exit status 64

The problem is in file: https://github.com/tensorflow/models/blob/master/syntaxnet/dragnn/tools/build_pip_package.py

MacOs doesn't support --no-preserve=all argument.

kiril-me avatar Apr 09 '17 19:04 kiril-me

I got the same issue

minhtuev avatar Apr 10 '17 06:04 minhtuev

Hi,

As a quick fix, you can try dropping no-preserve=all, or using 'gcp' instead of 'cp' (having first installed coreutils via 'brew install coreutils').

markomernick avatar Apr 10 '17 16:04 markomernick

Exactly that I did.

kiril-me avatar Apr 10 '17 17:04 kiril-me

After I did that, I was able to build but when I tried python tutorial_1.py i got this error:

Traceback (most recent call last):
  File "tutorial_1.py", line 11, in <module>
    from dragnn.python import graph_builder
  File "/Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/dragnn/python/graph_builder.py", line 30, in <module>
    tf.NotDifferentiable('ExtractFixedFeatures')
AttributeError: 'module' object has no attribute 'NotDifferentiable'

minhtuev avatar Apr 11 '17 05:04 minhtuev

@minhtuev Seems like you may have an outdated TensorFlow version installed. Can you try updating to 1.0 or 1.1 released and checking again?

bogatyy avatar Apr 11 '17 21:04 bogatyy

I cloned master today and I also have this issue on Mac

broncha avatar Apr 15 '17 13:04 broncha

The flag --no-preserve=all is not available on mac. I removed it and it worked

broncha avatar Apr 15 '17 13:04 broncha

Now I ran into this issue:

Traceback (most recent call last):
  File "tutorial_1.py", line 17, in <module>
    import dragnn.python.load_dragnn_cc_impl
  File "/Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/dragnn/python/load_dragnn_cc_impl.py", line 22, in <module>
    os.path.join(tf.resource_loader.get_data_files_path(), 'dragnn_cc_impl.so'))
  File "/Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so, 6): Symbol not found: __ZN10tensorflow24TfCheckOpHelperOutOfLineERKNS_6StatusEPKc
  Referenced from: /Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so
  Expected in: flat namespace
 in /Users/minhtuev/workspace/dep-parser/venv/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so

minhtuev avatar Apr 17 '17 04:04 minhtuev

same issue +1 remove --no-preserve=all /Users/mac/NLP/models/syntaxnet/dragnn/tools/build_pip_package.py

it works ! thank you all !

12343954 avatar Apr 26 '17 02:04 12343954

We have removed --no-preserve=all at head, so this issue should not recur.

markomernick avatar May 03 '17 18:05 markomernick