pytorch3d、Detectron2编译安装

基础环境:

python:3.6

ubuntu:18.04

pytorch:1.8

cuda:10.2

一、pytorch3d编译

官方指南 GitCode - 开发者的代码家园

注意:cuda11以下的版本,需要安装CUB libaray,cuda11以上的版本跳过此步骤。

conda install -c bottler nvidiacub

或通过源码方式安装:

curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz
tar xzf 1.10.0.tar.gz

配置CUB_HOME环境变量:

vim ~/.bashrc
# 注意将/home/bdlf/cub-1.10.0替换为对应的CUB包路径
export CUB_HOME=/home/bdlf/cub-1.10.0
# 更新一下
source ~/.bashrc

1、安装依赖:

conda install -c fvcore -c iopath -c conda-forge fvcore iopath

2、pytorch3d源码下载

根据自己环境,选择对应版本pytorch3d,这里选择V0.5.0。

3、编译

cd pytorch3d
pip install -e .

第一次在python3.8虚拟环境中采用上述方式顺利通过编译,但第二次更换python3.6环境后,一直编译失败,很是无语,望知道的小伙伴可以解答一下~~

参考链接 Pytorch3D Linux环境下安装(踩坑)记录_pytorch_帕斯卡多-华为云开发者联盟

 二、Detectron2编译

参考链接 Github 项目 - detectron2 安装与简单使用 - AI备忘录

Detectron2下载地址 https://download.csdn.net/download/WXG1011/89076387

我的GCC为7.5.0,但python为3.6,采用python -m pip install -e .安装提示ERROR: Package 'detectron2' requires a different Python: 3.6.7 not in '>=3.7',故采用python setup.py build develop,在编译过程中会出现包缺失或版本冲突的问题,直接pip安装丢失的包,再重新编译,重新编译时需删除Detectron2文件夹下的build文件。

编译成功提示:

Using /home/bdlf/.local/lib/python3.6/site-packages
Finished processing dependencies for detectron2==0.6

测试:

(py36) bdlf@bdlf-desktop:~/detectron2$ python
Python 3.6.7 | packaged by conda-forge | (default, Jan  7 2019, 02:49:06)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import detectron2
>>>

API文档 Installation — detectron2 0.6 documentation

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值