NamrataB
NamrataB

Reputation: 325

Debugging python tests in TensorFlow

We want to debug Python tests in TensorFlow such as sparse_split_op_test and string_to_hash_bucket_op_test

The other c++ tests we could debug using gdb, however we cannot find a way to debug python tests.

Is there a way in which we can debug specific python test case run via Bazel test command (for example, bazel test //tensorflow/python/kernel_tests:sparse_split_op_test)

Upvotes: 4

Views: 1477

Answers (1)

Allen Lavoie
Allen Lavoie

Reputation: 5808

I would first build the test:

bazel build //tensorflow/python/kernel_tests:sparse_split_op_test

Then use pdb on the resulting Python binary:

pdb bazel-bin/tensorflow/python/kernel_tests/sparse_split_op_test

That seems to work for me stepping through the first few lines of the test.

Upvotes: 3

Related Questions