Skip to content
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

could you help me about"AttributeError: 'str' object has no attribute 'pre_transform'" #479

Open
2hosun opened this issue Aug 31, 2024 · 0 comments

Comments

@2hosun
Copy link

2hosun commented Aug 31, 2024

from mmdet.apis import init_detector

config_file = "/content/drive/MyDrive/yoloword/yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py"
checkpoint_file = "/content/drive/MyDrive/yoloword/yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth"

yolo_model = init_detector(config_file, checkpoint_file, device='cuda:0')

text = ["A photo of a cat", "A photo of a dog"]
tokenized_text = yolo_model.backbone.text_model.tokenizer(text, padding=True, return_tensors="pt")
text_features = yolo_model.backbone.text_model(**tokenized_text)

print(text_features)

/content/drive/MyDrive/yoloword/third_party/mmyolo/configs/yolov8/yolov8_l_syncbn_fast_8xb16-500e_coco.py in
13 print(last_stage_out_channels)
14
---> 15 pre_transform = base.pre_transform
16 mosaic_affine_transform = base.mosaic_affine_transform
17 last_transform = base.last_transform

AttributeError: 'str' object has no attribute 'pre_transform'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant