pytorch3d报错:RuntimeError: Not compiled with GPU support.

目录

解决方法:编译之前:加上指令:

[解决方法:pytorch3d 安装命令(ubuntu),成功!!!](#解决方法:pytorch3d 安装命令(ubuntu),成功!!!)

测试代码:


FORCE_CUDA=1 works for me. Thanks!

python 复制代码
      args = (
            points,
            cloud_to_packed_first_idx,
            num_points_per_cloud,
            image_size,
            radius,
            points_per_pixel,
            bin_size,
            max_points_per_bin,
        )
        # pyre-fixme[16]: Module `pytorch3d` has no attribute `_C`.
        idx, zbuf, dists = _C.rasterize_points(*args)
        ctx.save_for_backward(points, idx)
        ctx.mark_non_differentiable(idx)
        return idx, zbuf, dists

解决方法:编译之前:加上指令:

set FORCE_CUDA=1

报错:没有指定CUDA_HOME

File "C:\Users\002\.conda\envs\glige\lib\site-packages\torch\utils\cpp_extension.py", line 1048, in CUDAExtension library_dirs += library_paths(cuda=True) File "C:\Users\002\.conda\envs\glige\lib\site-packages\torch\utils\cpp_extension.py", line 1186, in library_paths paths.append(_join_cuda_home(lib_dir)) File "C:\Users\002\.conda\envs\glige\lib\site-packages\torch\utils\cpp_extension.py", line 2223, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

方法1 重新安装命令 没测:

pip install "git+https://github.com/facebookresearch/pytorch3d.git"

方法2:

解决方法:pytorch3d 安装命令(ubuntu),成功!!!

pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html

File "C:\Users\002\.conda\envs\glige\lib\site-packages\torch\autograd\function.py", line 539, in apply

return super().apply(*args, **kwargs) # type: ignore[misc]

File "C:\Users\002\.conda\envs\glige\lib\site-packages\pytorch3d-0.7.7-py3.8-win-amd64.egg\pytorch3d\renderer\points\rasterize_points.py", line 214, in forward

idx, zbuf, dists = _C.rasterize_points(*args)

RuntimeError: Not compiled with GPU support

测试代码:

python 复制代码
import torch
from pytorch3d import _C
from pytorch3d.structures import Pointclouds

import torch

# 修改后的参数准备
points_tensor = torch.tensor([[0.5000, 0.5000, 0.5000], [1.0000, 1.0000, 1.0000]])
other_tensor = torch.tensor([[1., 2., 3.], [4., 5., 6.]])
value_tensor = torch.tensor(0.1000)

another_tensor = torch.tensor([0., 0., 0.])
int_value1 = 10
int_value2 = 0
int_value3 = 0

# 调用函数
idx, zbuf, dists = _C.rasterize_points(
    points_tensor,
    other_tensor,
    value_tensor,
    [10, 10],
    another_tensor,
    int_value1,
    int_value2,
    int_value3)

Traceback (most recent call last):

File "E:\project\inpaint\Inpaint-Anything-main\aaa2.py", line 18, in <module>

idx, zbuf, dists = _C.rasterize_points(

^^^^^^^^^^^^^^^^^^^^

RuntimeError: a Tensor with 3 elements cannot be converted to Scalar

相关推荐
机智的叉烧25 分钟前
前沿重器[57] | sigir24:大模型推荐系统的文本ID对齐学习
人工智能·学习·机器学习
凳子花❀28 分钟前
强化学习与深度学习以及相关芯片之间的区别
人工智能·深度学习·神经网络·ai·强化学习
泰迪智能科技012 小时前
高校深度学习视觉应用平台产品介绍
人工智能·深度学习
盛派网络小助手3 小时前
微信 SDK 更新 Sample,NCF 文档和模板更新,更多更新日志,欢迎解锁
开发语言·人工智能·后端·架构·c#
算法小白(真小白)3 小时前
低代码软件搭建自学第二天——构建拖拽功能
python·低代码·pyqt
唐小旭3 小时前
服务器建立-错误:pyenv环境建立后python版本不对
运维·服务器·python
007php0073 小时前
Go语言zero项目部署后启动失败问题分析与解决
java·服务器·网络·python·golang·php·ai编程
Eric.Lee20213 小时前
Paddle OCR 中英文检测识别 - python 实现
人工智能·opencv·计算机视觉·ocr检测
cd_farsight3 小时前
nlp初学者怎么入门?需要学习哪些?
人工智能·自然语言处理
AI明说3 小时前
评估大语言模型在药物基因组学问答任务中的表现:PGxQA
人工智能·语言模型·自然语言处理·数智药师·数智药学