Failing to build/test (bazel) Syntaxnet (Tensorflow) - tensorflow

I am trying to run the basic tutorial following the instruction at https://github.com/tensorflow/models/tree/master/syntaxnet
I am getting the following error when I do bazel test syntaxnet/... util/utf8/...
Following is the error snippet:
//syntaxnet:arc_standard_transitions_test PASSED in 0.0s
//syntaxnet:parser_features_test PASSED in 0.0s
//syntaxnet:sentence_features_test PASSED in 0.0s
//syntaxnet:shared_store_test PASSED in 0.2s
//syntaxnet:tagger_transitions_test PASSED in 0.0s
//util/utf8:unicodetext_unittest PASSED in 0.0s
//syntaxnet:beam_reader_ops_test FAILED in 0.1s
//syntaxnet:graph_builder_test FAILED in 0.1s
//syntaxnet:lexicon_builder_test FAILED in 0.1s
//syntaxnet:parser_trainer_test FAILED in 0.1s
//syntaxnet:reader_ops_test FAILED in 0.1s
//syntaxnet:text_formats_test FAILED in 0.1s
Executed 12 out of 12 tests: 6 tests pass and 6 fail locally.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
Is anybody familiar with this kind of error?
Any help will be appreciated.
Thank you very much in advance.

I was facing the same problem,until I found that it was a memory related problem.I build it on Ubuntu 14.04 with --local_resources 2048,.5,1.0 flag. Follow these steps:
1 get coorect version of bazel wget https://github.com/bazelbuild/bazel/releases/download/0.2.2b/bazel-0.2.2b-installer-linux-x86_64.sh
2 chmod +x bazel-0.2.2b-installer-linux-x86_64.sh
3 ./bazel-0.2.2b-installer-linux-x86_64.sh --user
4 git clone --recursive https://github.com/tensorflow/models.git
5 cd /models/syntaxnet/tensorflow
6 ./configure
7 cd ..
8 bazel test --local_resources 2048,.5,1.0 --genrule_strategy=standalone syntaxnet/... util/utf8/...
Hope this will help others!

You could try increasing your Virtual RAM. I had to make it 8GBs just to get it to work.
This link might help for that.
https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps

If you are on Mac, test it by using this command instead:
bazel test --linkopt=-headerpad_max_install_names \
syntaxnet/... util/utf8/...

Related

Error running tensorflow test_streaming_accuracy.cc

to run test_streaming_accuracy.cc , I ran the following command:
bazel run tensorflow/examples/speech_commands:test_streaming_accuracy --graph=/home/sweta/AudioRecognition/speech_commands_train/my_frozen_graph.pb --labels=/home/sweta/AudioRecognition/speech_commands_train/conv_labels.txt --wav=/home/sweta/AudioRecognition/speech_dataset/streaming_test_labels.wav --ground_truth=/home/sweta/AudioRecognition/speech_dataset/streaming_test_labels.txt --verbose
After executing this, I am getting the following error:
ERROR: Unrecognized option: --graph=/home/sweta/AudioRecognition/speech_commands_train/my_frozen_graph.pb
Anyone has any idea how to go about it?
In order to pass arguments to the binary under bazel run, you'll need to include an additional -- before your args, or else Bazel will parse those as arguments for itself.
e.g. bazel run //my/binary:target --verbose_failures -- --arg_for_binary_target=42

Not able to resolve the warnings being given by tensorflow

Whenever I run any script using Tensor Flow, I get the following warnings:
The TensorFlow library wasn't compiled to use SSE instructions, but
these are available on your machine and could speed up CPU
computations
I tried to follow the method posted on this stack overflow post and entered the following command on the command line:
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package
However I get the following error
The 'build' command is only supported from within a workspace.
How do I solve this error and then make the tensor flow compile using SSE instructions
The Installing Tensorflow from Sources page explains the procedure pretty well, make sure you have all the requirements met before running the build step.
If you wish to automate the ./configure (tensorflow-cpu) step you can run the following command from TF's root directory:
# CPU default configuration
tensorflow/tools/ci_build/builds/configured CPU
and then run the build command with native optimization:
# build with native optimization
bazel build -c opt --copt=-march=native tensorflow/tools/pip_package:build_pip_package

tutorials_example_trainer fails in debug mode (-c dbg)

The build for tutorials_example_trainer works fine in release mode (-c opt), but fails in debug mode (-c dbg).
Did anyone encounter this? It seems to be a bug.
The command I run:
bazel build -c dbg --config=cuda //tensorflow/cc:tutorials_example_trainer --verbose_failures
The build fails with the following message:
/usr/include/c++/4.8/mutex(125) (col. 5): error: calling a host
function("std::mutex_base::__mutex_base [subobject]") from a
__device function("std::mutex::mutex") is not allowed
< some warnings>
1 error detected in the compilation of
"/tmp/tmpxft_00005e78_00000000-10_cwise_op_gpu_log.cu.compute_52.cpp1.ii".
ERROR:
/home/uriv/git/tensorflow/tensorflow/tensorflow/core/BUILD:248:1:
output
'tensorflow/core/_objs/gpu_kernels/tensorflow/core/kernels/cwise_op_gpu_log.cu.pic.o'
was not created. ERROR:
/home/uriv/git/tensorflow/tensorflow/tensorflow/core/BUILD:248:1: not
all outputs were created.
Thanks.
You can workaround the problem by editing
tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h
and commenting out the following 2 lines of code:
static tensorflow::mutex m_devicePropInitMutex(tensorflow::LINKER_INITIALIZED);
and
tensorflow::mutex_lock l(m_devicePropInitMutex);
I'll push a proper fix to the tensorflow repository shortly.

Running seq2seq model error

I am trying to run the code in this tutorial.
When I try to run this command:
sudo bazel run -c opt tensorflow/models/rnn/translate/translate.py -- -- data_dir ../data/translate/
I get the following error:
...................
ERROR: Cannot run target //tensorflow/models/rnn/translate:translate.py: Not executable.
INFO: Elapsed time: 1.537s
ERROR: Build failed. Not running target.
Any ideas how to resolve?
It seems there are a lot of mistakes in the Tensorflow tutorial..
I was able to run it by removing the .py, and adding an extra -- before the options like:
bazel run -c opt tensorflow/models/rnn/translate/translate -- --data_dir /home/minsoo/tensorflowrnn/data
the directory part should be changed according to your system.
I ran it by going to the directory and running:
python translate.py

Error when try to compile Chromium

I try to use the command ninja -C out/Debug chrome to compile Chromium.
However the error msg says that:
ninja error loading 'build.ninja': the system cannot find the file specified
ninja Entering dictory 'out/Debug'
Could I know what's the problem?
Thanks.
The out directory and its contents (including build.ninja) are created by running
python build\gyp_chromium
or
gclient runhooks
Executing either command from within /src should allow your compile to proceed.
On Windows machine!
When I was running gn gen out/Default it also gave me an error:
ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
^----------
Current dir: D:/Chromium/src/out/Goma/
Command: C:/Python27/python.exe -- D:/Chromium/src/build/vs_toolchain.py get_toolchain_dir
Returned 1 and printed out:
Please follow the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
I did the following steps and it worked for me.
Set this variable. Reference (not sure about its purpose yet)
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
Run the command gn gen out/Default
Run the build command again
autoninja -C out/Default chrome
It is also recommended to run gclient sync from out/Default directory.
After the switch to "gn" you could try:
gn gen out/Debug