当前位置: 首页 > news >正文

重庆网站制作珠海公司惠州企业网站设计

重庆网站制作珠海公司,惠州企业网站设计,网络推广文案前景,深圳定制展会时间表引入 Grounding 目标检测模型串联 SAM 从而实现实例分割任务,目前支持 Grounding DINO 和 GLIP 参考教程 MMDetection-SAM 如果是 Grounding DINO 则安装如下依赖即可 cd playground pip install githttps://github.com/facebookresearch/segment-anything.git pip…

引入 Grounding 目标检测模型串联 SAM 从而实现实例分割任务,目前支持 Grounding DINO 和 GLIP

参考教程

MMDetection-SAM

如果是 Grounding DINO 则安装如下依赖即可

cd playground
pip install git+https://github.com/facebookresearch/segment-anything.git
pip install git+https://github.com/IDEA-Research/GroundingDINO.git # 需要编译 CUDA OP,请确保你的 PyTorch 版本、GCC 版本和 NVCC 编译版本兼容

如果是 GLIP 则安装如下依赖即可

cd playgroundpip install git+https://github.com/facebookresearch/segment-anything.git
pip install einops shapely timm yacs tensorboardX ftfy prettytable pymongo transformers nltk inflect scipy pycocotools opencv-python matplotlibgit clone https://github.com/microsoft/GLIP.git
cd GLIP; python setup.py build develop --user  # 需要编译 CUDA OP,请确保你的 PyTorch 版本、GCC 版本和 NVCC 编译版本兼容,暂时不支持 PyTorch 1.11+ 版本

执行功能演示代码报错

(mmdet-sam) hadoop@server:~/jupyter/mmdet-sam/playground/mmdet_sam$ python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/GroundingDINO_SwinT_OGC.py \
    ../models/groundingdino_swint_ogc.pth \
    -t "cat . remote" \
    --sam-device cpu
[nltk_data] Downloading package punkt to /home/hadoop/nltk_data...
[nltk_data]   Package punkt is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /home/hadoop/nltk_data...
[nltk_data]   Package averaged_perceptron_tagger is already up-to-
[nltk_data]       date!
final text_encoder_type: bert-base-uncased
pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 440M/440M [00:25<00:00, 17.2MB/s]
Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertModel: ['cls.predictions.transform.dense.bias', 'cls.predictions.decoder.weight', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.seq_relationship.bias', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.bias']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Traceback (most recent call last):
  File "detector_sam_demo.py", line 511, in <module>
    main()
  File "detector_sam_demo.py", line 438, in main
    det_model = build_detecter(args)
  File "detector_sam_demo.py", line 160, in build_detecter
    detecter = __build_grounding_dino_model(args)
  File "detector_sam_demo.py", line 117, in __build_grounding_dino_model
    checkpoint = torch.load(args.det_weight, map_location='cpu')
  File "/home/hadoop/anaconda3/envs/mmdet-sam/lib/python3.8/site-packages/torch/serialization.py", line 600, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "/home/hadoop/anaconda3/envs/mmdet-sam/lib/python3.8/site-packages/torch/serialization.py", line 242, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
OSError: [Errno 22] Invalid argument

其中 242行代码长这样

这个语句是打开一个文件, 检查输入参数

模型地址: ../models/groundingdino_swint_ogc.pth

发现此模型只有44k, 肯定不对, 重新下载模型, 有662M, 重新下载模型重新跑

遇到此问题, 在网上搜答案是找不到的, 还是要分析好自己的输入参数

http://www.yayakq.cn/news/790315/

相关文章:

  • 黑链 对网站的影响wordpress建网店
  • 淘宝电商运营培训长沙网站seo源头厂家
  • 网站建设技能考试试题三免费的推广网站
  • 购物网站发展规划与建设进度游戏推广引流软件
  • 网站整体框架甘肃做高端网站的公司
  • 网站建设服务是什么意思网站通常用什么编程做
  • 北京做手机网站外国人爱做视频网站吗
  • 北京网站建设培训机构个人装修接活app
  • 暗红色网站个人备案能做企业网站吗
  • 网站关键词整体方案建设网站技术公司简介
  • 邯郸网站建设的企业昆山网站备案
  • 浏览器怎么打开网站服务器自己做卖东西网站
  • 一家公司为什么要建官方网站电脑中安装wordpress
  • 用什么软件写网站郑州防控升级
  • 哪里有免费建设网站大学生html网页设计个人博客模板
  • 门户网站的区别服装公司网站多少钱
  • 网站开发 自学快闪视频制作软件app
  • 网站建设方法:新产品招区域总代理
  • 在线直播网站开发西安公司排名
  • 辽宁住房和城乡建设部网站雍熙网站建设
  • 外贸网站建设和优化哪些网站用天平做logo
  • 网站建设公司 校园网站网站建站网站的
  • 江门网站建设费用教做发绳的网站
  • 武威做网站的公司公众号服务平台
  • 图床网站怎么做阳江网上问政平台
  • 求个网站没封的90后小姑娘做网站
  • 网站与网站做外链好吗网上商城是什么
  • 广州网站建设信息科技有限公司我想自己在网站上发文章 怎样做
  • 网站架构教程社区教育网站建设方案
  • 百度云域名没有备案怎么做网站互联网医院