-
Notifications
You must be signed in to change notification settings - Fork 714
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
fix bug expand(torch.FloatTensor{[1, 1, 1, 33, 33]}, size=[1, -1, -1,… #1892
Conversation
… -1]): the number of sizes provided (4) must be greater or equal to the number of dimensions in the tensor (5)
Hi @qkhanh711, can you provide a more descriptive title and description to the PR? |
It happened when I clone anomalib repository. After installing, I have ran the 201_fastflow.ipynb (anomalib/notebooks/200_models/) `--------------------------------------------------------------------------- File ~/Code/computer_vision/EvaluateAD/anomalib/src/anomalib/models/image/patchcore/lightning_model.py:51, in Patchcore.init(self, backbone, layers, pre_trained, coreset_sampling_ratio, num_neighbors) File ~/Code/computer_vision/EvaluateAD/anomalib/src/anomalib/models/image/patchcore/torch_model.py:54, in PatchcoreModel.init(self, layers, backbone, pre_trained, num_neighbors) RuntimeError: expand(torch.FloatTensor{[1, 1, 1, 33, 33]}, size=[1, -1, -1, -1]): the number of sizes provided (4) must be greater or equal to the number of dimensions in the tensor (5) |
@qkhanh711 are you using the latest main branch? I am not able to reproduce the issue locally. datamodule = MVTec(
root=dataset_root,
category="bottle",
image_size=[256, 256],
train_batch_size=32,
eval_batch_size=32,
num_workers=0,
task=task,
)
model = Patchcore(backbone="wide_resnet50_2")
engine = Engine(
pixel_metrics="AUROC",
accelerator="auto", # \<"cpu", "gpu", "tpu", "ipu", "hpu", "auto">,
devices=1,
logger=False,
) |
yes, I'm using the main branch of https://github.com/openvinotoolkit/anomalib.git and a met this. |
do you solve this problem? I enchanted the same bug when running the 000 geting__started |
|
#1944 addressed this issue. This is no longer needed. Thanks a lot for reporting and proposing a fix. |
… -1]): the number of sizes provided (4) must be greater or equal to the number of dimensions in the tensor (5)
📝 Description
✨ Changes
Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.