Paddle3D icon indicating copy to clipboard operation
Paddle3D copied to clipboard

在使用CPU Paddle的情况下,Paddle3D install 出错

Open YangQun1 opened this issue 2 years ago • 4 comments

Hi,

在CPU平台下,遵循 https://github.com/PaddlePaddle/Paddle3D/blob/develop/docs/installation.md 中的步骤,安装Paddle3D会报如下的错误,可以麻烦看一下吗?

Paddle安装验证;

>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I0403 02:40:09.590196 110075 interpretercore.cc:282] New Executor is Running.
I0403 02:40:09.692342 110075 interpreter_util.cc:557] Standalone Executor is Used.
PaddlePaddle works well on 1 CPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>> paddle.device.is_compiled_with_cuda()
False

报错信息:

$ pip install -e .
Obtaining file:///home/qunyang/Paddle3D
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [156 lines of output]
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.VarBase' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Tracer' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAStream' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAEvent' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomDeviceStream' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomDeviceEvent' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.ProgramDesc' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.OpDesc' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Property' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.LoDTensorArray' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.XPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAPinnedPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.NPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.IPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.MLUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Tensor' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.SelectedRows' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.SparseCooTensor' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Generator' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      2023-04-03 02:42:09,171 -  WARNING - No custom op iou3d_nms_cuda found, try JIT build
      cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
      In file included from /home/qunyang/Paddle3D/paddle3d/ops/iou3d_nms/iou3d_cpu.cpp:21:
      /home/qunyang/Paddle3D/paddle3d/ops/iou3d_nms/iou3d_cpu.h:18:10: fatal error: cuda.h: No such file or directory
         18 | #include <cuda.h>
            |          ^~~~~~~~
      compilation terminated.
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.VarBase' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Tracer' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAStream' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAEvent' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomDeviceStream' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomDeviceEvent' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.ProgramDesc' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.OpDesc' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Property' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.LoDTensorArray' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CustomPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.XPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.CUDAPinnedPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.NPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.IPUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.MLUPlace' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Tensor' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.SelectedRows' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.SparseCooTensor' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      /home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/_bootstrap.py:219: FutureWarning: pybind11-bound class 'paddle.fluid.libpaddle.Generator' is using an old-style placement-new '__init__' which has been deprecated. See the upgrade guide in pybind11's docs. This message is only visible when compiled in debug mode.
        return f(*args, **kwds)
      error: command '/opt/rh/devtoolset-9/root/usr/bin/gcc' failed with exit code 1
      2023-04-03 02:42:11,114 -    ERROR - iou3d_nms_cuda builded fail!
      Traceback (most recent call last):
        File "/home/qunyang/Paddle3D/paddle3d/ops/__init__.py", line 156, in _load_module
          self.module = importlib.import_module(self.modulename)
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/importlib/__init__.py", line 127, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
        File "<frozen importlib._bootstrap>", line 983, in _find_and_load
        File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
      ModuleNotFoundError: No module named 'iou3d_nms_cuda'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/site-packages/paddle/utils/cpp_extension/extension_utils.py", line 1307, in run_cmd
          return subprocess.check_call(command, shell=True, stdout=DEVNULL)
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/subprocess.py", line 363, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'cd /home/qunyang/.cache/paddle_extensions && /home/qunyang/miniconda3/envs/pd/bin/python iou3d_nms_cuda_setup.py build' returned non-zero exit status 1.
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/qunyang/Paddle3D/setup.py", line 20, in <module>
          import paddle3d
        File "/home/qunyang/Paddle3D/paddle3d/__init__.py", line 28, in <module>
          from . import datasets, models, transforms
        File "/home/qunyang/Paddle3D/paddle3d/datasets/__init__.py", line 16, in <module>
          from .kitti import KittiDepthDataset, KittiMonoDataset, KittiPCDataset
        File "/home/qunyang/Paddle3D/paddle3d/datasets/kitti/__init__.py", line 15, in <module>
          from .kitti_depth_det import KittiDepthDataset
        File "/home/qunyang/Paddle3D/paddle3d/datasets/kitti/kitti_depth_det.py", line 26, in <module>
          import paddle3d.transforms as T
        File "/home/qunyang/Paddle3D/paddle3d/transforms/__init__.py", line 19, in <module>
          from paddle3d.transforms.reader import *
        File "/home/qunyang/Paddle3D/paddle3d/transforms/reader.py", line 30, in <module>
          from paddle3d.models.detection.bevfusion.utils import generate_guassian_depth_target, map_pointcloud_to_image
        File "/home/qunyang/Paddle3D/paddle3d/models/__init__.py", line 18, in <module>
          from .heads import *
        File "/home/qunyang/Paddle3D/paddle3d/models/heads/__init__.py", line 16, in <module>
          from .dense_heads import *
        File "/home/qunyang/Paddle3D/paddle3d/models/heads/dense_heads/__init__.py", line 15, in <module>
          from .anchor3d_head import *
        File "/home/qunyang/Paddle3D/paddle3d/models/heads/dense_heads/anchor3d_head.py", line 23, in <module>
          from paddle3d.models.detection.bevfusion.utils import box3d_multiclass_nms
        File "/home/qunyang/Paddle3D/paddle3d/models/detection/bevfusion/utils.py", line 23, in <module>
          from paddle3d.ops.iou3d_nms_cuda import nms_gpu
        File "<frozen importlib._bootstrap>", line 1032, in _handle_fromlist
        File "/home/qunyang/Paddle3D/paddle3d/ops/__init__.py", line 174, in __getattr__
          module = self._load_module()
        File "/home/qunyang/Paddle3D/paddle3d/ops/__init__.py", line 160, in _load_module
          self.module = self.jit_build()
        File "/home/qunyang/Paddle3D/paddle3d/ops/__init__.py", line 148, in jit_build
          name=self.modulename, sources=sources, **args)
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/site-packages/paddle/utils/cpp_extension/cpp_extension.py", line 944, in load
          _jit_compile(file_path, verbose)
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/site-packages/paddle/utils/cpp_extension/extension_utils.py", line 1268, in _jit_compile
          run_cmd(compile_cmd, verbose)
        File "/home/qunyang/miniconda3/envs/pd/lib/python3.7/site-packages/paddle/utils/cpp_extension/extension_utils.py", line 1311, in run_cmd
          "Failed to run command: {}, errors: {}".format(compile, error)
      RuntimeError: Failed to run command: <built-in function compile>, errors: Command 'cd /home/qunyang/.cache/paddle_extensions && /home/qunyang/miniconda3/envs/pd/bin/python iou3d_nms_cuda_setup.py build' returned non-zero exit status 1.
      Compiling user custom op, it will cost a few seconds.....
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

YangQun1 avatar Apr 03 '23 02:04 YangQun1

@YangQun1 这个问题是因为有些自定义算子只有CUDA实现,建议在支持GPU的环境下安装Paddle3D

nepeplwu avatar Apr 03 '23 09:04 nepeplwu

@YangQun1 这个问题是因为有些自定义算子只有CUDA实现,建议在支持GPU的环境下安装Paddle3D

请问对于这些只有CUDA实现的算子,Paddle3D可否提供相应的配置选项,允许用户在使用CPU的时候,将这些算子disable掉?

YangQun1 avatar Apr 03 '23 13:04 YangQun1

你好,我在windows环境cpu下遇到了和你一样的问题,最后你解决了吗?怎么解决的?

lvpinrui avatar Jun 09 '23 01:06 lvpinrui

@YangQun1 这些算子都是自定义算子,没有官方的CPU实现,无法fallback到CPU上运行。另外3D检测的模型计算量都比较大,用CPU运行会非常慢,建议还是使用GPU运行

nepeplwu avatar Feb 01 '24 07:02 nepeplwu