tensorflow / tflite-support

TFLite Support is a toolkit that helps users to develop ML and deploy TFLite models onto mobile / ioT devices.
Apache License 2.0
369 stars 124 forks source link

pip install tflite-model-maker not working #938

Open TheInfamousPro opened 1 year ago

TheInfamousPro commented 1 year ago

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 commented 1 year ago

cython

lu-wang-g commented 1 year ago

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

TheInfamousPro commented 1 year ago

Is there a older version that works?

TheInfamousPro commented 1 year ago

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 commented 1 year ago

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

aryan57 commented 1 year ago

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

cikichen commented 1 year ago

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):
DuleaM commented 11 months ago

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

bduyng commented 10 months ago

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"