CenterNet环境搭建记录

这篇博客记录了在安装CenterNet时遇到的问题及解决方法。问题包括:1) 修改cudnn设置以避免错误;2) 缺少cython导致`make coco`失败,通过`pip install cython`解决;3) 编译可形变卷积模块时找不到nvcc命令,需将nvcc添加到环境变量,并确保与pytorch版本匹配。解决这些问题后,成功安装并运行了预训练模型。

CenterNet仓库链接:

https://github.com/xingyizhou/CenterNet

记录一下跟着INSTALL.md走的过程遇到的一些问题

问题1:更改cudnn

这一步倒是没报错,记录一下这个命令的意思。

把对应py文件的1254行中的torch.backends.cudnn.enabled替换成False

执行完以后可以去py文件里检查一下,或者自己手动替换

# PYTORCH=/path/to/pytorch # usually ~/anaconda3/envs/CenterNet/lib/python3.6/site-packages/
# for pytorch v0.4.0
sed -i "1194s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py
# for pytorch v0.4.1
sed -i "1254s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py

 问题2:make coco报错

gcc: error: pycocotools/_mask.c: No such file or directory
error: command 'gcc' failed with exit status 1
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1

 原因是新环境没有安装cython,  -->pip install cython即可

问题3:编译可形变卷积报错

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值