Debug报错:THC\THC.h: No such file or directory; pip从.git子文件夹中安装指定分支

Debug报错:THC\THC.h: No such file or directory; pip从.git子文件夹中安装

问题1描述
编译Pointnet2.PyTorch仓库中的setup.py时报THC\THC.h: No such file or directory。

问题解决
原因是THC.h在pytorch 1.11版本中被移除了,需要修改代码。仓库issues给除了解决方法:

//Comment Out /src/ball_query.cpp group_points.cpp interpolate.cpp pointnet2_api.cpp sampling.cpp
把上面列出的文件的以下行注释掉
//#include <THE/THC.h>
//extern THCState *state;
//cudaStream_t stream = THCState_getCurrentStream(state);

改为
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/CUDAEvent.h>
cudaStream_t stream = at::cuda::getCurrentCUDAStream();

然后
replace the AT_CHECK with TORCH_CHECK in the ball_query.cpp

问题2描述
部分仓库中setup.py文件在子文件夹中,需要使用pip install 从子文件夹中直接安装某个分支

解决方案
比如上面这个PointNet2.Pytorch仓库的setup.py在子文件夹pointnet2中,可以这样安装branch分支:

pip install git+https://github.com/sshaoshuai/Pointnet2.PyTorch.git@master#subdirectory=pointnet2
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值