Skip to content

Instantly share code, notes, and snippets.

View trzy's full-sized avatar

Bart Trzynadlowski trzy

View GitHub Profile
@trzy
trzy / memory_leak.py
Created January 19, 2022 21:33
PyTorch Memory Leak and Redundant .detach()
This file has been truncated, but you can view the full file.
from dataclasses import dataclass
import numpy as np
import random
import torch as t
from torch import nn
from torchvision.ops import nms
from torch.nn import functional as F
from torchvision.ops import RoIPool
from torchvision.models import vgg16