【FocalNet】学习笔记

1. 介绍

“FocalNet是map-based还是token-based模型呢?”

FocalNet是token-based模型,与常见的【基于 feature map 的CNN】不同;

2. 模型代码

2.1 环境配置 [DINO | FocalNet-DINO]

2.1.1 配置CUDA11.1

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.1/
Samples:  Installed in /root/, but missing recommended libraries

Please make sure that
 -   PATH includes /usr/local/cuda-11.1/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-11.1/lib64, or, add /usr/local/cuda-11.1/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.1/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least .00 is required for CUDA 11.1 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver

Logfile is /var/log/cuda-installer.log

2.1.2 创建conda环境

conda create --name dino python=3.7.3

2.1.3 进入conda环境

conda activate dino

2.1.4 清理之前的Torch安装

conda remove torchaudio torchvision pytorch

2.1.5 安装PyTorch

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 \
torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

2.1.6 Clone项目

git clone https://github.com/FocalNet/FocalNet-DINO.git

2.1.7 编译算子ops

cd models/dino/ops
python setup.py build install
unit test (should see all checking is True)
python test.py

3. Issue:训练无法复现

在这里插入图片描述
我们已经在其github上提出了issue

3. 模型复现

3.1 Ubuntu22.04移植

3.1.1 环境要求

CUDA ≥ 11.6(对于11.3,PyTorch官方 或者 Conda-Forge 没有提供预编译库)
在这里插入图片描述

3.1.2 环境配置

安装PyTorch
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 \
cudatoolkit=11.6 -c pytorch -c conda-forge
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值