Closed haobo827 closed 2 years ago
should I set test_batch_size=1?
Can you share the tree structure of your dataset please?
Can you share the tree structure of your dataset please?
data -wafer_line --ground_truth ---Positive --test ---Positive ---Negative --train ---Negative
And I find too much time for "corest sampling" beacuse: it's calculating minimum distance using cpu, it's about one and half hour on my cpu, and lower coreset_sampling_ratio will reduce computation time, but it also reduce performance? right?
I want to know if there is a good way to solve this cpu calculation problem.(i use Tesla V100S-PCIE-32GB )
Can you set accelerator: "gpu" # <"cpu", "gpu", "tpu", "ipu", "hpu", "auto">
to auto
? It shouldn't train on CPU. If it does, there is something wrong
should I set test_batch_size=1?
Yes, if you set test_batch_size: 1
, it would work. We'll investigate why it doesn't work for multiple batch sizes.
should I set test_batch_size=1?
Yes, if you set
test_batch_size: 1
, it would work. We'll investigate why it doesn't work for multiple batch sizes.
You are right. Much appreciate!
Hi @samet-akcay , thanks for developing this amazing library!
We'll investigate why it doesn't work for multiple batch sizes.
Is any investigation done since then? It'd be great if you could share any info around here if any. I'm running inference over about 18000 images. Although there is still plenty of GPU memory available during inference, due to batch size 1 restriction, inference takes more than 10 hours to finish. So, it'd be great if we could set batch size more than 1.
@fujikosu, we have just merged #580, which should address the multiple batch size problem. Let us know if you still encounter any issues. Thanks!
I have another problem after dealing with #243 That is: ValueError: Either
preds
andtarget
both should have the (same) shape (N, ...), ortarget
should be (N, ...) andpreds
should be (N, C, ...). Epoch 0: 100%|██████████| 34/34 [09:17<00:00, 16.39s/it, loss=nan]From: File "/home/devadmin/haobo/anomalib_venv/lib/python3.8/site-packages/torchmetrics/utilities/checks.py", line 269, in _check_classification_inputs case, implied_classes = _check_shape_and_type_consistency(preds, target) File "/home/devadmin/haobo/anomalib_venv/lib/python3.8/site-packages/torchmetrics/utilities/checks.py", line 115, in _check_shape_and_type_consistency
Then I print preds and target: Epoch 0: 68%|████████████████Aggregating the embedding extracted from the training set. 2.13it/s, loss=nan] Creating CoreSet Sampler via k-Center Greedy Getting the coreset from the main embedding. Assigning the coreset as the memory bank. Epoch 0: 100%|█████████████████████████████████████████████████████| 34/34 [08:59<00:00, 15.85s/it, loss=nan] preds is: tensor([1.4457])00%|███████████████████████████████████████████████| 11/11 [08:48<00:00, 48.02s/it] target is: tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=torch.int32)
my patchcore config.yaml is:
Thank you for your patience in reading and answering!