unilm 推理脚本在DiT目标检测上无法工作

dsekswqp  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(45)

描述bug

我使用的模型(UniLM,MiniLM,LayoutLM等):

  • 双任务分类

问题出现在使用以下两种情况时:

  • 官方示例脚本:(详细说明如下)
  • 我自己的修改过的脚本:(详细说明如下)

我按照描述设置了环境,但当我尝试像文档中那样使用inference.py时,我得到了
Failed to download https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_mrcnn.pth
urllib.error.HTTPError: HTTP Error 409: Public access is not permitted on this storage account

重现问题

重现此行为所需的步骤:

  1. 为DiT设置环境
  2. ( https://github.com/microsoft/unilm/tree/master/dit/object_detection )

预期行为

对您期望发生的事情进行清晰简洁的描述。
预计能够下载权重。

  • 平台:
  • Python版本:3.9.18
  • PyTorch版本(GPU?):1.9.0+cu102
zz2j4svz

zz2j4svz1#

一个可行的解决方案是将权重下载为zip文件:
https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_mrcnn.pth?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D
然后将点模型权重指向该zip文件:

python ./dit/object_detection/inference.py
--image_path ./dit/object_detection/publaynet_example.jpeg
--output_file_name output.jpg
--config ./dit/object_detection/publaynet_configs/maskrcnn/maskrcnn_dit_base.yaml
--opts MODEL.WEIGHTS publaynet_dit-b_mrcnn.zip

更多详细信息可以在这里找到:
#1246
更新:
上面的zip文件链接已经失效。我猜测DIT团队可能并不希望任何人能够访问他们的预训练权重。

o2gm4chl

o2gm4chl2#

你好,我尝试了这种解决方法,但仍然不断收到身份验证错误。我可以在其他地方找到权重吗?

1bqhqjot

1bqhqjot3#

我已经在这段示例代码中找到了权重:https://huggingface.co/Sebas6k/DiT_weights/tree/main

相关问题