Spaces:
Runtime error
Runtime error
Commit ·
7fe568e
1
Parent(s): 2a75de9
Update custom_resnet.py
Browse files- custom_resnet.py +1 -9
custom_resnet.py
CHANGED
|
@@ -2,18 +2,10 @@ from pytorch_lightning import LightningModule, Trainer, seed_everything
|
|
| 2 |
import torch
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
-
import
|
| 6 |
-
from PIL import Image
|
| 7 |
from torch.nn import functional as F
|
| 8 |
-
from collections import OrderedDict
|
| 9 |
from torchvision import transforms
|
| 10 |
-
from pytorch_grad_cam import GradCAM
|
| 11 |
-
from pytorch_grad_cam.utils.image import show_cam_on_image
|
| 12 |
-
from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget
|
| 13 |
from pytorch_lightning import LightningModule, Trainer, seed_everything
|
| 14 |
-
import albumentations as A
|
| 15 |
-
from albumentations.pytorch import ToTensorV2
|
| 16 |
-
import torchvision.transforms as T
|
| 17 |
|
| 18 |
class LitResnet(LightningModule):
|
| 19 |
def __init__(self, lr=0.01, drop= 0.05, norm='BN',groupsize=1):
|
|
|
|
| 2 |
import torch
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
+
import torch.nn as nn
|
|
|
|
| 6 |
from torch.nn import functional as F
|
|
|
|
| 7 |
from torchvision import transforms
|
|
|
|
|
|
|
|
|
|
| 8 |
from pytorch_lightning import LightningModule, Trainer, seed_everything
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
class LitResnet(LightningModule):
|
| 11 |
def __init__(self, lr=0.01, drop= 0.05, norm='BN',groupsize=1):
|