Getting 'Killed' while trying to run 'pytest keras_cv'

Followed each and every step as mentioned here keras-cv/CONTRIBUTING.md at c8efcd78c64fc67f2f5238b5107be581d3899286 · keras-team/keras-cv · GitHub. I think the issue is probably related to CPU usage (not sure though but that’s the case most probably).

Here is the full output of ‘pytest keras_cv’:
========================================= test session starts =========================================
platform linux – Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/pyrath/Desktop/keras_3/keras-cv
configfile: setup.cfg
plugins: timeout-2.3.1, xdist-3.5.0, requests-mock-1.10.0
collected 1940 items

keras_cv/bounding_box/converters_test.py s…sssssssssssssssssssssssssssssssssssssssssss… [ 2%]
…sssssssssssssssssss [ 7%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 12%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssss…s. [ 15%]
keras_cv/bounding_box/ensure_tensor_test.py s…s [ 15%]
keras_cv/bounding_box/iou_test.py s…s. [ 16%]
keras_cv/bounding_box/mask_invalid_detections_test.py s.sss [ 16%]
keras_cv/bounding_box/to_dense_test.py sss [ 16%]
keras_cv/bounding_box/to_ragged_test.py s.sss [ 17%]
keras_cv/bounding_box/utils_test.py s…s [ 17%]
keras_cv/bounding_box/validate_format_test.py s…s [ 17%]
keras_cv/callbacks/pycoco_callback_test.py ssss [ 17%]
keras_cv/callbacks/waymo_evaluation_callback_test.py sss [ 18%]
keras_cv/core/factor_sampler/constant_factor_sampler_test.py s…s [ 18%]
keras_cv/core/factor_sampler/uniform_factor_sampler_test.py s…s [ 18%]
keras_cv/datasets/load_test.py s…s [ 18%]
keras_cv/datasets/pascal_voc/segmentation_test.py s…s. [ 19%]
keras_cv/datasets/waymo/load_test.py ssss [ 19%]
keras_cv/datasets/waymo/transformer_test.py sssss [ 19%]
keras_cv/keypoint/converters_test.py s…s [ 20%]
keras_cv/keypoint/utils_test.py s…s [ 20%]
keras_cv/layers/augmenter_test.py s…s [ 21%]
keras_cv/layers/feature_pyramid_test.py s…s. [ 21%]
keras_cv/layers/fusedmbconv_test.py s…s. [ 21%]
keras_cv/layers/mbconv_test.py s…s. [ 22%]
keras_cv/layers/object_detection/anchor_generator_test.py s…s [ 22%]
keras_cv/layers/object_detection/box_matcher_test.py s…s [ 23%]
keras_cv/layers/object_detection/multi_class_non_max_suppression_test.py sss [ 23%]
keras_cv/layers/object_detection/non_max_suppression_test.py s…s [ 23%]
keras_cv/layers/object_detection/roi_generator_test.py ssssssss [ 23%]
keras_cv/layers/object_detection/roi_pool_test.py s…s [ 24%]
keras_cv/layers/object_detection/roi_sampler_test.py s…s.s [ 25%]
keras_cv/layers/object_detection/rpn_label_encoder_test.py s…ss [ 25%]
keras_cv/layers/object_detection/sampling_test.py s…s [ 25%]
keras_cv/layers/object_detection_3d/centernet_label_encoder_test.py ss… [ 26%]
keras_cv/layers/object_detection_3d/voxel_utils_test.py s…s [ 26%]
keras_cv/layers/object_detection_3d/voxelization_test.py ss…Killed

Any help/advice would be appreciated!
Thanks in advance!

Hi @Sarthak_Jain, Thanks for posting this issue.

The killed message suggests that the process was terminated maybe due to running out of memory or excessive CPU usage. Since you’re using pytest with xdist check if you’re running too many tests in parallel. You could try running specific test files or try isolating the tests and check what is causing high memory usage and later optimize your code.

If possible try running your code on a different environment such as cloud instance.

Let me know if this works for you.
Thanks!