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

初始化模型报错 #3988

Open
shusuxiang opened this issue May 11, 2024 · 1 comment
Open

初始化模型报错 #3988

shusuxiang opened this issue May 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shusuxiang
Copy link

正在将 samples/llm/img/分布式训练技术原理-幕布图片-57107-679259.jpg 添加到向量库,共包含1条文档
Batches: 0%| | 0/1 [00:00<?, ?it/s]2024-05-11 10:53:49,844 - utils.py[line:377] - ERROR: RuntimeError: 从文件 samples/test_files/test.txt 加载文档时出错:
object has no attribute nms:
File "D:\conda\envs\chatchat\Lib\site-packages\torchvision\ops\boxes.py", line 41
_log_api_usage_once(nms)
_assert_has_ops()
return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
'nms' is being compiled since it was called from '_batched_nms_vanilla'
File "D:\conda\envs\chatchat\Lib\site-packages\torchvision\ops\boxes.py", line 109
for class_id in torch.unique(idxs):
curr_indices = torch.where(idxs == class_id)[0]
curr_keep_indices = nms(boxes[curr_indices], scores[curr_indices], iou_threshold)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
keep_mask[curr_indices[curr_keep_indices]] = True
keep_indices = torch.where(keep_mask)[0]
'_batched_nms_vanilla' is being compiled since it was called from 'batched_nms'
File "D:\conda\envs\chatchat\Lib\site-packages\torchvision\ops\boxes.py", line 73
# pytorch/vision#1311 (comment)
if boxes.numel() > (4000 if boxes.device.type == "cpu" else 20000) and not torchvision._is_tracing():
return _batched_nms_vanilla(boxes, scores, idxs, iou_threshold)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
else:
return _batched_nms_coordinate_trick(boxes, scores, idxs, iou_threshold)
'batched_nms' is being compiled since it was called from 'generate_detections'
File "D:\conda\envs\chatchat\Lib\site-packages\effdet\anchors.py", line 140
scores[top_detection_idx] = soft_scores
else:
top_detection_idx = batched_nms(boxes, scores, classes, iou_threshold=0.5)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

# keep only top max_det_per_image scoring predictions

'generate_detections' is being compiled since it was called from '_batch_detection'
File "D:\conda\envs\chatchat\Lib\site-packages\effdet\bench.py", line 82
img_scale_i = None if img_scale is None else img_scale[i]
img_size_i = None if img_size is None else img_size[i]
detections = generate_detections(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class_out[i],
~~~~~~~~~~~~~
box_out[i],
~~~~~~~~~~~
anchor_boxes,
~~~~~~~~~~~~~
indices[i],
~~~~~~~~~~~
classes[i],
~~~~~~~~~~~
img_scale_i,
~~~~~~~~~~~~
img_size_i,
~~~~~~~~~~~
max_det_per_image=max_det_per_image,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
soft_nms=soft_nms,
~~~~~~~~~~~~~~~~~ <--- HERE
)
batch_detections.append(detections)

@shusuxiang shusuxiang added the bug Something isn't working label May 11, 2024
Copy link

dosubot bot commented May 11, 2024

The error you're encountering, "object has no attribute nms," points to an issue with the torchvision package, specifically with the Non-Maximum Suppression (nms) function not being found. This function is crucial for object detection tasks to remove redundant bounding boxes. To resolve this, ensure you have the correct version of torchvision installed, as the error might arise from a version mismatch. The Langchain-Chatchat project specifies torchvision==0.16.2 in its requirements. Verify your installed version with pip show torchvision in your Conda environment.

If the problem persists after confirming the torchvision version, consider checking your environment for unnecessary packages, especially if effdet is not explicitly required for your project. Providing more specific details about your setup and the steps leading to the error could further help in diagnosing the issue.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

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