Aitor
Aitor
Thank you for your reply and for trying the codes. Currently, the name "out_masks" is used for the result of the classification. Previously, the name "out_masks" was used for the...
I updated all the codes and four files were modified including 1. datasets/brains18.py 2. models/resnet.py 3. model.py and 4. train.py. The codes would be find below.
''' Dataset for training Written by Whalechen ''' import math import os import random import torch import numpy as np from torch.utils.data import Dataset import nibabel from scipy import ndimage...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math from functools import partial __all__ = [ 'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152',...
import torch from torch import nn from models import resnet def generate_model(opt): assert opt.model in [ 'resnet' ] if opt.model == 'resnet': assert opt.model_depth in [10, 18, 34, 50, 101,...
''' Training code for MRBrainS18 datasets segmentation Written by Whalechen ''' from setting import parse_opts from datasets.brains18 import BrainS18Dataset from model import generate_model import torch import numpy as np from...
This err rises if the input format of LOSS and label mismatch. You might check these codes In Train.py: loss_seg = nn.CrossEntropyLoss(ignore_index=-1) In brains18.py: class_array = int(ith_info[2]) class_array = torch.tensor(class_array,...
The new layer's name should be "conv_seg" in resnet.py (for not bothering to change the setting.py file).