Comments (3)
Hi! this is a great paper! and I want to ask how to use trainer.py to train the model?
Hello, Do you know how to train the model yet? Thanks.
from patrecon.
@Sungden If you're still working on this, the below code should help you get a start
import torch
import torch.nn as nn
import argparse
from torchsummary import summary
from net import *
from trainer import Trainer_ReconNet
from data import MyReconDataset # Your dataset class
import os
# os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
###########################
########ARGUMENTS##########
parser = argparse.ArgumentParser(description='A test program.')
parser.add_argument("--exp", default='exp1', help="test1")
parser.add_argument("--arch", default='ReconNet', help="test1")
parser.add_argument("--print_freq", default=2, help="test1")
parser.add_argument("--output_path", default='output/', help="test1")
parser.add_argument("--resume", default=False, help="test1")
parser.add_argument("--loss", default='l2', help="test1")
parser.add_argument("--optim", default='adam', help="test1")
parser.add_argument("--lr", default=1e-4, help="test1")
parser.add_argument("--weight_decay", default=0.99, help="test1")
args = parser.parse_args()
###########################
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
trainer_obj = Trainer_ReconNet(args)
root_path = '/path/to/your/dataset'
train_dataset = MyReconDataset(root_path + '/images/*.png', root_path + '/volumes/*.nii.gz')
train_dataloader = torch.utils.data.DataLoader(train_dataset, batch_size=1)
for epoch in range(5):
print('Epoch:', epoch+1)
trainer_obj.train_epoch(train_dataloader, epoch + 1)
from patrecon.
hi,i also want to retrain the model but it need the csv file with annotation.Do you know this file or how to design this file?
Thank you very much!
from patrecon.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patrecon.