BinaryPairwiseMeasures.__init__() got an unexpected keyword argument 'axis'
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Đọc monai/metrics/wrapper.py tại MetricsReloadedBinary._compute_tensor và so sánh lệnh gọi BinaryPairwiseMeasures của nó với API MetricsReloaded đã cài đặt. Chạy lại ví dụ MONAI được cung cấp; được xem là hoàn tất khi cả hai lệnh gọi metric và aggregate(reduction="none") đều thực thi mà không gặp lỗi trục không mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When I ran the example in MONAI, I encountered this error.
MONAI version 1.3.2
MetricsReloaded version 0.1.0
The example code is as follows:
import torch
from monai.metrics import MetricsReloadedBinary
metric_name = "Cohens Kappa"
metric = MetricsReloadedBinary(metric_name=metric_name)
y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 1.0]]]])
y = torch.tensor([[[[1.0, 0.0], [1.0, 1.0]]]])
print(metric(y_pred, y))
y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 0.0]]]])
y = torch.tensor([[[[1.0, 0.0], [1.0, 1.0]]]])
print(metric(y_pred, y))
print(metric.aggregate(reduction="none"))
metric.reset()
The errors are as follows:
{
"name": "TypeError",
"message": "BinaryPairwiseMeasures.__init__() got an unexpected keyword argument 'axis'",
"stack": "---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
File /home/bowen/git/prostate/practice.py:13
11 y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 1.0]]]])
12 y = torch.tensor([[[[1.0, 0.0], [1.0, 1.0]]]])
---> 13 print(metric(y_pred, y))
15 # second iteration
16 # shape [batch=1, channel=1, 2, 2]
17 y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 0.0]]]])
File ~/.conda/envs/pytorch/lib/python3.11/site-packages/monai/metrics/metric.py:347, in CumulativeIterationMetric.__call__(self, y_pred, y, **kwargs)
327 def __call__(
328 self, y_pred: TensorOrList, y: TensorOrList | None = None, **kwargs: Any
329 ) -> torch.Tensor | Sequence[torch.Tensor | Sequence[torch.Tensor]]:
330 \"\"\"
331 Execute basic computation for model prediction and ground truth.
332 It can support both `list of channel-first Tensor` and `batch-first Tensor`.
(...)
345 a `batch-first` tensor (BC[HWD]) or a list of `batch-first` tensors.
346 \"\"\"
--> 347 ret = super().__call__(y_pred=y_pred, y=y, **kwargs)
348 if isinstance(ret, (tuple, list)):
349 self.extend(*ret)
File ~/.conda/envs/pytorch/lib/python3.11/site-packages/monai/metrics/metric.py:80, in IterationMetric.__call__(self, y_pred, y, **kwargs)
78 if isinstance(y_pred, torch.Tensor):
79 y_ = y.detach() if isinstance(y, torch.Tensor) else None
---> 80 return self._compute_tensor(y_pred.detach(), y_, **kwargs)
81 raise ValueError(\"y_pred or y must be a list/tuple of `channel-first` Tensors or a `batch-first` Tensor.\")
File ~/.conda/envs/pytorch/lib/python3.11/site-packages/monai/metrics/wrapper.py:169, in MetricsReloadedBinary._compute_tensor(self, y_pred, y)
166 y = convert_to_numpy(y)
168 # Create binary pairwise metric object
--> 169 bpm = BinaryPairwiseMeasures(y_pred, y, axis=tuple(range(2, dims)), smooth_dr=1e-5)
171 # Is requested metric available?
172 if self.metric_name not in bpm.metrics:
TypeError: BinaryPairwiseMeasures.__init__() got an unexpected keyword argument 'axis'"
}
- Ngôn ngữ chính
- Python
- Star
- 105
- Fork
- 18
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Project-MONAI/MetricsReloaded
-
Documentation: AssignmentMappingĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
MorphologyOps.foreground_component() ignores connectivity parameter, always uses 1-connectivityCó thể đã có người làm @Mirochill đã nhận 142 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của Project-MONAI/MetricsReloaded
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aws-samples/sample-per-model-bedrock#243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FuRongJun-1999/dsh-memory#404 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PennyLaneAI/catalyst#3337 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workflow.schedule stops when a cron deadline passes before sleepCó thể đã có người làm @HuaTNA đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày