PatchCore_anomaly_detection
PatchCore_anomaly_detection copied to clipboard
when i tested some images by the code, the usage is getting bigger
when i tested some images by the code, the usage is getting bigger。 I find the problem is caused by the line code(features = self(x)): def test_step(self, batch, batch_idx): # Nearest Neighbour Search self.embedding_coreset = pickle.load(open(os.path.join(self.embedding_dir_path, 'embedding.pickle'), 'rb')) x, gt, label, file_name, x_type = batch # extract embedding features = self(x) embeddings = [] for feature in features: m = torch.nn.AvgPool2d(3, 1, 1) embeddings.append(m(feature)) I used torch.no_gard() and torch.cuda.empty_cache(), but it is unuseful. why?