tensorflow / models

Models and examples built with TensorFlow
Other
77.25k stars 45.75k forks source link

ERROR: /models/research/syntaxnet/dragnn/tools/BUILD:147:1: failed to create symbolic link 'dragnn/tools/model_trainer_test': file 'dragnn/tools/model_trainer_test.sh' is not executable #4186

Closed SaintNazaire closed 6 years ago

SaintNazaire commented 6 years ago

OS Platform and Distribution

TensorFlow installed from

TensorFlow version

Bazel version

Exact command to reproduce

cd /models/research/syntaxnet && bazel build ... --subcommands --explain=/tmp/bazel_build_log.txt --verbose_explanations=True --verbose_failures

What is the top-level directory of the model you are using

/models/research/syntaxnet

Have I written custom code (as opposed to using a stock example script provided in TensorFlow)

Spent past three months migrating step by step Syntaxnet towards Bazel and Tensorflow current releases instead of Bazel 0.5.4 and Tensorflow 1.3 to migrate towards:

Describe the problem

After clearing a lot of obstacles I reach the far end of the build process with much warning but no error up to executing

SUBCOMMAND: # //dragnn/tools:model_trainer_test [action 'Creating runfiles tree bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles'] (cd /root/.cache/bazel/_bazel_root/3b4c7ccb85580bc382ce4a52e9580003/execroot/main && \ exec env - \ PYTHON_BIN_PATH=/usr/bin/python \ PYTHON_LIB_PATH=/usr/lib/python2.7 \ TF_DOWNLOAD_CLANG=0 \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL_SYCL=0 \ _bin/build-runfiles bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles_manifest bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles)

ERROR: /models/research/syntaxnet/dragnn/tools/BUILD:147:1: failed to create symbolic link 'dragnn/tools/model_trainer_test': file 'dragnn/tools/model_trainer_test.sh' is not executable

Introspecting /models/research/syntaxnet/dragnn/tools/BUILD:147:1 leads to the following function

sh_test(
    name = "model_trainer_test",
    size = "medium",
    srcs = ["model_trainer_test.sh"],
    data = [
        ":model_trainer",
        ":testdata",
    ],
    deps = [
    ],
)

After attempting to launch the /bin/bash script within the docker container's console

/models/research/syntaxnet/dragnn/tools# /bin/bash model_train

I get the following error message

model_trainer_test.sh: line 25: TEST_SRCDIR: unbound variable

Introspecting model_trainer_test.sh I find the following variables declaration

readonly DRAGNN_DIR="${TEST_SRCDIR}/${TEST_WORKSPACE}/dragnn"
readonly MODEL_TRAINER="${DRAGNN_DIR}/tools/model_trainer"
readonly MODEL_DIR="${DRAGNN_DIR}/tools/testdata/biaffine.model"
readonly CORPUS="${DRAGNN_DIR}/tools/testdata/small.conll"
readonly TMP_DIR="/tmp/model_trainer_test.$$"
readonly TMP_MODEL_DIR="${TMP_DIR}/biaffine.model"

Back to the console trying to output each of the variable's values, for example

echo ${TEST_SRCDIR} or echo ${DRAGNN_DIR} for instance results in empty variables

I find other references elsewhere in the code, e.g.

But from the bazel log it seems my build has failed before I could get there.

@bogatyy @nealwu you edited those files, any clue? @terryykoo, any precious insight of yours to impart?

Error logs

SUBCOMMAND: # //dragnn/tools:model_trainer_test [action 'Creating runfiles tree bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles'] (cd /root/.cache/bazel/_bazel_root/3b4c7ccb85580bc382ce4a52e9580003/execroot/main && \ exec env - \ PYTHON_BIN_PATH=/usr/bin/python \ PYTHON_LIB_PATH=/usr/lib/python2.7 \ TF_DOWNLOAD_CLANG=0 \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL_SYCL=0 \ _bin/build-runfiles bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles_manifest bazel-out/k8-opt/bin/dragnn/tools/model_trainer_test.runfiles)

ERROR: /models/research/syntaxnet/dragnn/tools/BUILD:147:1: failed to create symbolic link 'dragnn/tools/model_trainer_test': file 'dragnn/tools/model_trainer_test.sh' is not executable

SaintNazaire commented 6 years ago

silly of me, the solution was to grant execute permission to all .sh files

chmod +x /models/research/syntaxnet/dragnn/tools/model_trainer_test.sh