tensorflow / models

Models and examples built with TensorFlow
Other
77.23k stars 45.75k forks source link

Problems installing tf-models-official #11220

Closed torienyart closed 5 months ago

torienyart commented 5 months ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/packages/tf2/setup.py

2. Describe the bug

Setup gets stuck while trying to install PyYAML with a subprocess-exited-with-error response.

Collecting pyyaml<6.0,>=5.1 (from tf-models-official>=2.5.1->object_detection==0.1)
  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
  ╰─> [54 lines of output]
      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 "/Users/torienyart/wahoo/qa/object_detection_model/odm_venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/torienyart/wahoo/qa/object_detection_model/odm_venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/torienyart/wahoo/qa/object_detection_model/odm_venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 968, in run_command
          super().run_command(command)
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 550, in run
          self.add_defaults()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
          sdist.add_defaults(self)
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 102, in add_defaults
          super().add_defaults()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 250, in add_defaults
          self._add_defaults_ext()
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 335, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 201, in get_source_files
        File "/private/var/folders/8w/7l5t8npn523bv1f8x7ysnjfw0000gr/T/pip-build-env-quegtlq9/overlay/lib/python3.11/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.

I have tried uninstalling PyYAML and Cython and reinstalling... i've tried starting from scratch with a new environment, i've tried a software update... it doesn't seem to want to work with PyYAML

3. Steps to reproduce

Clone tensorflow model garden to local repo cd into models/research/object_detection/packages/tf2 copy setup.py to research folder run python -m pip install .

this also happens when I run pip install tf-models-official

4. Expected behavior

I expect the setup to run fully and install all necessary packages

5. Additional context

Include any logs that would be helpful to diagnose the problem.

6. System information

laxmareddyp commented 5 months ago

Hi @torienyart,

There seems to be a conflict between your research code and the tf-models-official package from PyPI. When you run setup.py from the research folder, it looks for a specific version of tf-models-official (greater than 2.5.1) from PyPI.However, the latest version of tf-models-official installed from PyPI might not be compatible with your research code. This is because the latest version often pulls in dependencies like PyYAML and Cython at their most recent versions, which might not be what your research code expects. Manually Install Compatible Versions: You can try modifying the requirements.txt file to specify the exact versions of PyYAML and Cython that are compatible with your research code. Then, install these specific versions manually using pip.

Thanks.

github-actions[bot] commented 5 months ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 5 months ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 5 months ago

Are you satisfied with the resolution of your issue? Yes No

Masumekeshavarzi commented 4 months ago

I had the same problem and I tried by creating new anaconda environment with python 3.10 and installing tensorflow-models-offical .whl file downloaded from their website