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
30.7k stars 7.51k forks source link

D2 package does not meet the requirements of PEP 518 and PEP 491 #2644

Closed chiboreache closed 3 years ago

chiboreache commented 3 years ago

causing problem with building

related issue https://github.com/python-poetry/poetry/issues/3712

Instructions To Reproduce the Issue and Full Logs

try to install via poetry

Your Environment

Arch Linux Python 3.9


useless data for bot

appuser@365bfc56cfa5:~/detectron2_repo$ wget -nc -q https://github.com/facebookresearch/detectron2/raw/master/detectron2/utils/collect_env.py && python collect_env.py
Failed to load OpenCL runtime
/home/appuser/.local/lib/python3.6/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
---------------------  -------------------------------------------------------------------------
sys.platform           linux
Python                 3.6.9 (default, Oct  8 2020, 12:12:24) [GCC 8.4.0]
numpy                  1.19.5
detectron2             0.3 @/home/appuser/detectron2_repo/detectron2
Compiler               GCC 7.5
CUDA compiler          not available
DETECTRON2_ENV_MODULE  <not set>
PyTorch                1.7.1+cu101 @/home/appuser/.local/lib/python3.6/site-packages/torch
PyTorch debug build    False
GPU available          False
Pillow                 8.1.0
torchvision            0.8.2+cu101 @/home/appuser/.local/lib/python3.6/site-packages/torchvision
fvcore                 0.1.3
cv2                    3.2.0
---------------------  -------------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 
github-actions[bot] commented 3 years ago

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

ppwwyyxx commented 3 years ago

Instructions and full logs are not provided, so I cannot understand what the issue is.

As for the request to support PEP518, it is not feasible due to dependency on cuda and pytorch.

chiboreache commented 3 years ago

@ppwwyyxx install poetry

try to install broken D2 package

chiboreache commented 3 years ago

https://github.com/python-poetry/poetry

ppwwyyxx commented 3 years ago

Because poetry does not support selecting cuda version https://github.com/python-poetry/poetry/issues/2145 there is no reasonable way to support detectron2.

chiboreache commented 3 years ago

once again

Accoring to the setup.py, torch is needed to build the wheel, but the maintainers doesn't provide a pyproject.toml according to PEP 518. I've described a workaround on stackoverflow for a similar case. But it would be nice, if you can open an issue in dectron2 issue tracker.

ERROR: detectron2-0.3+cu110-cp38-cp38-linux_x86_64.whl is not a supported wheel on this platform.

What OS are you using and what python version? Furthermore I'm not sure if the filename is correct according to PEP 491 thinking

--

https://www.python.org/dev/peps/pep-0518/

https://www.python.org/dev/peps/pep-0491/#file-name-convention

ppwwyyxx commented 3 years ago

I've read the above comments. They do not change the fact I stated in https://github.com/facebookresearch/detectron2/issues/2644#issuecomment-782898524