profile
viewpoint

Ask questionsFailed to run the unit test of bonus_tests

<em>Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em>

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Centos7.6
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 2.0 master branch, commit-id:af019188adc704569b7cce51e50eba489af1a725
  • Python version: 3.6
  • Bazel version (if compiling from source): 0.27.1
  • GCC/Compiler version (if compiling from source): 6.3
  • CUDA/cuDNN version:
  • GPU model and memory:

You can collect some of this information using our environment capture script You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior After build from source code:

bazel --output_user_root=$build_dir build --config=v2 //tensorflow/tools/pip_package:build_pip_package 

I run the unit test:

bazel --output_user_root=$build_dir test //tensorflow/core/kernels:bonus_tests

It failed with the error message:

ERROR: no such target '//tensorflow/core/kernels:bonus_tests': target 'bonus_tests' not declared in package 'tensorflow/core/kernels' (did you mean 'loss_test'?) defined by /home/lesliefang/debug_failrunbonus_tests/tensorflow/tensorflow/core/kernels/BUILD INFO: Elapsed time: 0.382s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) FAILED: Build did NOT complete successfully (0 packages loaded)

Describe the expected behavior The unit test should run successfully.

Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. As the description above.

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

tensorflow/tensorflow

Answer questions akuegel

The name of the tf_cc_tests rule is never used to create an executable. If you check the definition, it creates executable tests for each of the entries in srcs (their name derived from name of their source file). So you can for example run: bazel --output_user_root=$build_dir test //tensorflow/core/kernels:adjust_contrast_op_test (this is the first of the created tests from the bonus_tests target).

useful!

Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib'
Error occurred when finalizing GeneratorDataset iterator
ModuleNotFoundError: No module named 'tensorflow.contrib'
When importing TensorFlow, error loading Hadoop hot 4
The flag 'log_dir' is defined twice. hot 3
[TF 2.0] Dataset has no attribute 'make_one_shot_iterator' hot 3
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 3
TF2.0 AutoGraph issue hot 3
Error loading tensorflow hot 3
AttributeError: module 'tensorflow' has no attribute 'set_random_seed' hot 3
AttributeError: module &#39;tensorflow&#39; has no attribute &#39;Session&#39; hot 3
No tf.lite.experimental.nn.bidirectional_dynamic_rnn ops is finded hot 3
AttributeError: module 'tensorflow' has no attribute 'app' hot 3
Incorrect Error TypeError: padded_batch() missing 1 required positional argument: &#39;padded_shapes&#39; hot 3
tensorflow2.0 detected 'xla_gpu' , but 'gpu' expected hot 2
Github User Rank List