Skip to content

FileNotFoundError in test_bundle_trt_export #8354

Description

@KumoLiu
[2025-02-18T15:17:28.748Z] ======================================================================

[2025-02-18T15:17:28.748Z] ERROR: test_onnx_trt_export_0_fp32 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.748Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.748Z] Traceback (most recent call last):

[2025-02-18T15:17:28.748Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.748Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 123, in test_onnx_trt_export

[2025-02-18T15:17:28.748Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.748Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.748Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.748Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.748Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

[2025-02-18T15:17:28.748Z] 

[2025-02-18T15:17:28.748Z] ======================================================================

[2025-02-18T15:17:28.748Z] ERROR: test_onnx_trt_export_1_fp16 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.748Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.748Z] Traceback (most recent call last):

[2025-02-18T15:17:28.748Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.748Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 123, in test_onnx_trt_export

[2025-02-18T15:17:28.748Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.748Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.748Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.748Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.748Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

[2025-02-18T15:17:28.748Z] 

[2025-02-18T15:17:28.748Z] ======================================================================

[2025-02-18T15:17:28.748Z] ERROR: test_trt_export_0_fp32 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.748Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.748Z] Traceback (most recent call last):

[2025-02-18T15:17:28.748Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.748Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 85, in test_trt_export

[2025-02-18T15:17:28.748Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.748Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.748Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.748Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.748Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

[2025-02-18T15:17:28.748Z] 

[2025-02-18T15:17:28.748Z] ======================================================================

[2025-02-18T15:17:28.748Z] ERROR: test_trt_export_1_fp16 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.748Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.748Z] Traceback (most recent call last):

[2025-02-18T15:17:28.748Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.748Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 85, in test_trt_export

[2025-02-18T15:17:28.748Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.748Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.748Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.748Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.748Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

[2025-02-18T15:17:28.748Z] 

[2025-02-18T15:17:28.748Z] ======================================================================

[2025-02-18T15:17:28.748Z] ERROR: test_trt_export_2_fp32 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.748Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.748Z] Traceback (most recent call last):

[2025-02-18T15:17:28.748Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.748Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 85, in test_trt_export

[2025-02-18T15:17:28.748Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.748Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.748Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.748Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.749Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.749Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

[2025-02-18T15:17:28.749Z] 

[2025-02-18T15:17:28.749Z] ======================================================================

[2025-02-18T15:17:28.749Z] ERROR: test_trt_export_3_fp16 (tests.bundle.test_bundle_trt_export.TestTRTExport)

[2025-02-18T15:17:28.749Z] ----------------------------------------------------------------------

[2025-02-18T15:17:28.749Z] Traceback (most recent call last):

[2025-02-18T15:17:28.749Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2025-02-18T15:17:28.749Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2025-02-18T15:17:28.749Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/test_bundle_trt_export.py", line 85, in test_trt_export

[2025-02-18T15:17:28.749Z]     parser.read_config(config_file)

[2025-02-18T15:17:28.749Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 319, in read_config

[2025-02-18T15:17:28.749Z]     content.update(self.load_config_files(f, **kwargs))

[2025-02-18T15:17:28.749Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 426, in load_config_files

[2025-02-18T15:17:28.749Z]     config_dict = cls.load_config_file(i, **kwargs)

[2025-02-18T15:17:28.749Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/bundle/config_parser.py", line 398, in load_config_file

[2025-02-18T15:17:28.749Z]     with open(_filepath) as f:

[2025-02-18T15:17:28.749Z] FileNotFoundError: [Errno 2] No such file or directory: '/home/jenkins/agent/workspace/Monai-latest-image/tests/bundle/testing_data/inference.json'

Activity

  1. KumoLiu commented on Feb 19, 2025

    @KumoLiu
    ContributorAuthor

    Hi @garciadias, could you please help take a look at this issue? It should be due to refactor that the file can't be found in this test. Thanks!

  2. garciadias commented on Feb 19, 2025

    @garciadias
    Collaborator

    Hi @KumoLiu, I think I have solved the problem.
    While running the ./runtests.sh -f -u --net --coverage locally I see two errors:

    ======================================================================
    ERROR: test_ngc_private_source_download_bundle_0 (tests.bundle.test_bundle_download.TestDownload)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/rd24/kcl/MONAI/tests/test_utils.py", line 827, in command_line_tests
        normal_out = subprocess.run(cmd, env=test_env, check=True, capture_output=True)
      File "/home/rd24/.pyenv/versions/3.9.21/lib/python3.9/subprocess.py", line 528, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['coverage', 'run', '-m', 'monai.bundle', 'download', '--args_file', '/tmp/tmpzbelz9a1/def_args.json', '--progress', 'False', '--source', 'ngc_private']' returned non-zero exit status 1.
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/home/rd24/kcl/MONAI/.venv/lib/python3.9/site-packages/parameterized/parameterized.py", line 620, in standalone_func
        return func(*(a + p.args), **p.kwargs, **kw)
      File "/home/rd24/kcl/MONAI/tests/bundle/test_bundle_download.py", line 189, in test_ngc_private_source_download_bundle
        command_line_tests(cmd)
      File "/home/rd24/kcl/MONAI/tests/test_utils.py", line 833, in command_line_tests
        raise RuntimeError(f"subprocess call error {e.returncode}: {errors}, {output}") from e
    RuntimeError: subprocess call error 1: b'Traceback (most recent call last):
      File "/home/rd24/kcl/MONAI/monai/bundle/__main__.py", line 31, in <module>
        fire.Fire()
      File "/home/rd24/kcl/MONAI/.venv/lib/python3.9/site-packages/fire/core.py", line 135, in Fire
        component_trace = _Fire(component, args, parsed_flag_args, context, name)
      File "/home/rd24/kcl/MONAI/.venv/lib/python3.9/site-packages/fire/core.py", line 468, in _Fire
        component, remaining_args = _CallAndUpdateTrace(
      File "/home/rd24/kcl/MONAI/.venv/lib/python3.9/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace
        component = fn(*varargs, **kwargs)
      File "/home/rd24/kcl/MONAI/monai/bundle/scripts.py", line 558, in download
        raise ValueError(f"repo should be in the form of `org/org_name/team/team_name` or `org/org_name`, got {repo_}.")
    ValueError: repo should be in the form of `org/org_name/team/team_name` or `org/org_name`, got Project-MONAI/model-zoo/hosting_storage_v1.
    ', b"2025-02-19 09:47:40,313 - INFO - --- input summary of monai.bundle.scripts.download ---
    2025-02-19 09:47:40,313 - INFO - > name: 'brats_mri_segmentation'
    2025-02-19 09:47:40,313 - INFO - > bundle_dir: '/tmp/tmpzbelz9a1'
    2025-02-19 09:47:40,313 - INFO - > source: 'ngc_private'
    2025-02-19 09:47:40,313 - INFO - > remove_prefix: 'monai_'
    2025-02-19 09:47:40,313 - INFO - > progress: False
    2025-02-19 09:47:40,313 - INFO - ---
    
    
    "
    
    ======================================================================
    ERROR: test_ensemble (tests.integration.test_auto3dseg_ensemble.TestEnsembleBuilder)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/rd24/kcl/MONAI/tests/integration/test_auto3dseg_ensemble.py", line 174, in test_ensemble
        algo.train(_train_param)
      File "/tmp/tmpicj_8wjl/workdir/algorithm_templates/dints/scripts/algo.py", line 496, in train
      File "/home/rd24/kcl/MONAI/monai/apps/auto3dseg/bundle_gen.py", line 277, in _run_cmd
        return run_cmd(cmd.split(), run_cmd_verbose=True, env=ps_environ, check=True)
      File "/home/rd24/kcl/MONAI/monai/utils/misc.py", line 892, in run_cmd
        return subprocess.run(cmd_list, **kwargs)
      File "/home/rd24/.pyenv/versions/3.9.21/lib/python3.9/subprocess.py", line 528, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['python', '/tmp/tmp32lmbvhi/workdir/dints_0/scripts/train.py', 'run', "--config_file='/tmp/tmp32lmbvhi/workdir/dints_0/configs/hyper_parameters.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/hyper_parameters_search.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/network.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/network_search.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/transforms_infer.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/transforms_train.yaml,/tmp/tmp32lmbvhi/workdir/dints_0/configs/transforms_validate.yaml'", '--training#num_images_per_batch=2', '--training#num_epochs=2', '--training#num_epochs_per_validation=1']' returned non-zero exit status 1.

    Would you like me to solve these on this PR as well?

  3. KumoLiu commented on Feb 19, 2025

    @KumoLiu
    ContributorAuthor

    Hi @garciadias, thank you for the quick fix! The first error you mentioned is due to the absence of a private NGC org arg setting, which has been configured in the CI environment, so that should be fine.

    As for the second issue, I will leave it to @mingxin-zheng help take a look at it.

    In the meantime, we can go ahead and merge your PR. Thanks again!

  4. added a commit that references this issue on Feb 20, 2025
    d98f348
  5. KumoLiu commented on Feb 21, 2025

    @KumoLiu
    ContributorAuthor

    One missing place:

    tests_dir = Path(__file__).resolve().parent

    cc @garciadias

  6. added a commit that references this issue on Feb 21, 2025
    a790590
  7. added 2 commits that reference this issue on Mar 10, 2025
    ab46efc
    a9a7082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions