PatchCore_anomaly_detection icon indicating copy to clipboard operation
PatchCore_anomaly_detection copied to clipboard

when i tested some images by the code, the usage is getting bigger

Open leolv131 opened this issue 3 years ago • 0 comments

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?

leolv131 avatar Nov 22 '21 11:11 leolv131