Skip to content

Commit 0f1cf5d

Browse files
disable pin memory + bug fix
1 parent ace014f commit 0f1cf5d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

trainer.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
ds,
5151
batch_size=args.batch_size,
5252
shuffle=True,
53-
num_workers=args.num_workers,
54-
pin_memory=True
53+
num_workers=args.num_workers
5554
)
5655
feature_extractor = transform(**kwargs).to(device)
5756

@@ -92,7 +91,7 @@
9291
with torch.no_grad():
9392
x = x.to(device)
9493
x = feature_extractor(x) + 1
95-
x = x.log()
94+
x = x.log().detach()
9695
target = target.to(device)
9796

9897
# forward pass
@@ -134,4 +133,4 @@
134133
if args.save_checkpoint:
135134
save_checkpoint(args.save_path, model, criterion, optimizer, epoch)
136135

137-
save_checkpoint(model, criterion, optimizer, epoch)
136+
save_checkpoint(args.save_path, model, criterion, optimizer, epoch)

0 commit comments

Comments
 (0)