facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
29.3k stars 7.32k forks source link

Fix torch dependency requirement and code formatting in setup.py #5296

Open Programmer-RD-AI opened 1 month ago

Programmer-RD-AI commented 1 month ago

This PR addresses issue #5228 reported by @mdvthu. The changes ensure that the torch dependency requirement in the setup.py file of Detectron2 is correctly specified, aligning with actual version compatibility. Additionally, the code formatting and readability in the setup.py file have been improved for better consistency.

Before submitting this PR, I have run dev/linter.sh to ensure that the code adheres to the project's linting standards.

Thank you for considering this contribution!

sliedes commented 2 weeks ago

torch seems to also be a build requirement. Adding it in setup.py as a dependency still doesn't seem to fix everything.

I got detectron2 to install with poetry add $url by just creating a pyproject.toml with these contents:

[build-system]
requires = ["setuptools", "torch"]

Though in addition to that it should be added in setup.py like this PR does.

mostlyuseful commented 1 week ago

torch seems to also be a build requirement. Adding it in setup.py as a dependency still doesn't seem to fix everything.

I got detectron2 to install with poetry add $url by just creating a pyproject.toml with these contents:

[build-system]
requires = ["setuptools", "torch"]

Though in addition to that it should be added in setup.py like this PR does.

Tried it in a fork, that was the missing piece for my setup. Thanks so much!