tflite-support icon indicating copy to clipboard operation
tflite-support copied to clipboard

pip install tflite-model-maker not working

Open TheInfamousPro opened this issue 2 years ago • 9 comments

Collecting pyyaml<6.0,>=5.1 (from tf-models-nightly->tflite-model-maker) Using cached PyYAML-5.4.1.tar.gz (175 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [68 lines of output] C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\config\setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3\PyYAML.egg-info\PKG-INFO
  writing dependency_links to lib3\PyYAML.egg-info\dependency_links.txt
  writing top-level names to lib3\PyYAML.egg-info\top_level.txt
  Traceback (most recent call last):
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
      super().run_command(command)
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 314, in run
      self.find_sources()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 322, in find_sources
      mm.run()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 551, in run
      self.add_defaults()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 589, in add_defaults
      sdist.add_defaults(self)
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\command\sdist.py", line 104, in add_defaults
      super().add_defaults()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-67ro6oql\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

TheInfamousPro avatar Aug 09 '23 11:08 TheInfamousPro

cython

TheInfamousPro avatar Aug 09 '23 11:08 TheInfamousPro

That's right. We'll fix this issue first in MediaPipe Model Maker later this week. Please stay tuned.

lu-wang-g avatar Aug 10 '23 04:08 lu-wang-g

Is there a older version that works?

TheInfamousPro avatar Aug 10 '23 07:08 TheInfamousPro

okay apparently it is talking about how somethings are deprecated in numpy 1.20 after i installed it. It also cannot detect my RTX 3060

TheInfamousPro avatar Aug 11 '23 14:08 TheInfamousPro

Modules imported 2023-08-11 22:11:39.644050: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2023-08-11 22:11:39.644281: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\read_weights.py:28: FutureWarning: In the future np.object will be defined as the corresponding NumPy scalar. np.uint8, np.uint16, np.object, np.bool] Traceback (most recent call last): File "C:\Users\Admin\Desktop\main.py", line 4, in from tflite_model_maker.config import ExportFormat, QuantizationConfig File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tflite_model_maker_init_.py", line 44, in from tflite_model_maker import audio_classifier File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tflite_model_maker\audio_classifier_init_.py", line 24, in from tensorflow_examples.lite.model_maker.core.data_util.audio_dataloader import DataLoader File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_examples\lite\model_maker\core\data_util\audio_dataloader.py", line 27, in from tensorflow_examples.lite.model_maker.core.task.model_spec import audio_spec File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_examples\lite\model_maker\core\task\model_spec_init_.py", line 20, in from tensorflow_examples.lite.model_maker.core.task.model_spec import audio_spec File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_examples\lite\model_maker\core\task\model_spec\audio_spec.py", line 29, in from tensorflow_examples.lite.model_maker.core.task import model_util File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_examples\lite\model_maker\core\task\model_util.py", line 28, in from tensorflowjs.converters import converter as tfjs_converter File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs_init_.py", line 21, in from tensorflowjs import converters File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\converters_init_.py", line 21, in from tensorflowjs.converters.converter import convert File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\converters\converter.py", line 35, in from tensorflowjs.converters import keras_h5_conversion as conversion File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\converters\keras_h5_conversion.py", line 33, in from tensorflowjs import write_weights # pylint: disable=import-error File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\write_weights.py", line 25, in from tensorflowjs import read_weights File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflowjs\read_weights.py", line 28, in np.uint8, np.uint16, np.object, np.bool] File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy_init_.py", line 319, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'object'. np.object was a deprecated alias for the builtin object. To avoid this error in existing code, use object by itself. Doing this will not modify any behavior and is safe. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

TheInfamousPro avatar Aug 11 '23 14:08 TheInfamousPro

I am facing the same error and cannot install it, can someone help please

aryan57 avatar Aug 23 '23 15:08 aryan57

me too, mac m1

 Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [68 lines of output]
      /private/var/folders/t1/t4n_16gn7pn2p6fyrpj84g340000gn/T/pip-build-env-z6raz21l/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!

              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):

cikichen avatar Aug 25 '23 11:08 cikichen

I'm still facing this issue, what's the status ?

DuleaM avatar Oct 12 '23 12:10 DuleaM

I got the same issue and was able to fix by using this hack:

echo "Cython<3" > cython_constraint.txt
$ PIP_CONSTRAINT=cython_constraint.txt pip install "tflite-model-maker"

bduyng avatar Nov 16 '23 03:11 bduyng