Skip to content

在mindnlp的mindnlp.transformers.AutoModelForObjectDetection.from_pretrained方法中无法识别conditional_detr,无法加载 #1973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4everImmortality opened this issue Mar 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@4everImmortality
Copy link
Contributor

4everImmortality commented Mar 4, 2025

Describe the bug/ 问题描述 (Mandatory / 必填)

在mindnlp的mindnlp.transformers.AutoModelForObjectDetection.from_pretrained方法中无法识别conditional_detr

  • Hardware Environment(`cpu ) / 硬件环境:

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (2.5.0) :
    -- mindnlp version 0.4.0
    -- Python version (e.g., Python 3.9) :
    -- OS platform and distribution (e.g., Linux Ubuntu 24.04):

To Reproduce / 重现步骤 (Mandatory / 必填)
复现错误

import matplotlib.pyplot as plt
import mindspore
from mindspore import Tensor, ops
from mindnlp.transformers import AutoImageProcessor, AutoModelForObjectDetection
from PIL import Image
import requests

# set the device to GPU if available
mindspore.set_device(device_target="GPU" if mindspore.context.get_context("device_target") == "GPU" else "CPU")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

# need to use a compatible image processor
image_processor = AutoImageProcessor.from_pretrained("./microsoft/conditional-detr-resnet-50")

# need to use a compatible model for object detection
model = AutoModelForObjectDetection.from_pretrained("./microsoft/conditional-detr-resnet-50")

Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.
希望可以正常的加载模型并且去做finetune

Screenshots/ 日志 / 截图 (Mandatory / 必填)
If applicable, add screenshots to help explain your problem.

Image

@4everImmortality 4everImmortality added the bug Something isn't working label Mar 4, 2025
@4everImmortality 4everImmortality changed the title 在mindnlp的mindnlp.transformers.AutoModelForObjectDetection.from_pretrained方法中无法识别conditional_detr,无法加载, 在mindnlp的mindnlp.transformers.AutoModelForObjectDetection.from_pretrained方法中无法识别conditional_detr,无法加载 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant