Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ct.models.utils.bisect_model requires pytest to be installed #2419

Open
atiorh opened this issue Dec 17, 2024 · 1 comment
Open

ct.models.utils.bisect_model requires pytest to be installed #2419

atiorh opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
bug Unexpected behaviour that should be corrected (type) triaged Reviewed and examined, release as been assigned if applicable (status)

Comments

@atiorh
Copy link
Contributor

atiorh commented Dec 17, 2024

🐞Describing the bug

ct.models.utils.bisect_model requires pytest to be installed

To Reproduce

pip install coremltools && python -c "import coremltools as ct;ct.models.utils.bisect_model(...)"

@atiorh atiorh added the bug Unexpected behaviour that should be corrected (type) label Dec 17, 2024
@TobyRoseman TobyRoseman added the triaged Reviewed and examined, release as been assigned if applicable (status) label Dec 18, 2024
@TobyRoseman
Copy link
Collaborator

I can reproduce this issue. Here is the stack trace:

File ~/miniconda3/envs/prod/lib/python3.10/site-packages/coremltools/models/utils.py:2006, in bisect_model(model, output_dir, merge_chunks_to_pipeline, check_output_correctness)
   2003     else:
   2004         mlmodel = model
-> 2006     _verify_output_correctness_of_chunks(
   2007         full_model=mlmodel,
   2008         first_chunk_model=model_chunk1,
   2009         second_chunk_model=model_chunk2,
   2010     )
   2012 # save model chunks
   2013 _os.makedirs(output_dir, exist_ok=True)

File ~/miniconda3/envs/prod/lib/python3.10/site-packages/coremltools/models/utils.py:2056, in _verify_output_correctness_of_chunks(full_model, first_chunk_model, second_chunk_model, pipeline_model)
   2054 """Verifies the end-to-end output correctness of full (original) model versus chunked models"""
   2055 # lazy import avoids circular error
-> 2056 from coremltools.converters.mil.testing_utils import compute_snr_and_psnr
   2057 from coremltools.converters.mil.testing_utils import (
   2058     random_gen_input_feature_type as random_gen_input_feature_type,
   2059 )
   2061 def report_correctness(original_outputs: _np.ndarray, final_outputs: _np.ndarray, log_prefix: str):

File ~/miniconda3/envs/prod/lib/python3.10/site-packages/coremltools/converters/mil/testing_utils.py:13
     10 from typing import Dict, List, Optional, Tuple, Union
     12 import numpy as np
---> 13 import pytest
     14 from PIL import Image
     16 import coremltools as ct

ModuleNotFoundError: No module named 'pytest'

@cymbalrush cymbalrush self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behaviour that should be corrected (type) triaged Reviewed and examined, release as been assigned if applicable (status)
Projects
None yet
Development

No branches or pull requests

3 participants