Comments (2)
Ok, thank you very much for your reply. I'll study it carefully and then try it. Thank you very much.
from transgan.
Hi @mapengsen,
I didn't use any breakpoints during training; however, you can do the following at train.py
from this blog which I directly put here. I hope this will be helpful for you;
First set two parameters:
start_epoch: The number of epochs to start training during renewal
resume: Whether to implement breakpoint resume training
start_epoch = 0
resume = True
After the model and optimizer are set up, add the following code, load the checkpoint and then train,
if opt.resume:
if os.path.isfile('checkpoint'):
checkpoint = torch.load('checkpoint')
start_epoch = checkpoint['epoch'] + 1
model.load_state_dict(checkpoint['model'])
optimizer.load_state_dict(checkpoint['optimizer'])
print("=> loaded checkpoint (epoch {})".format(checkpoint['epoch']))
else:
print("=> no checkpoint found")
After each round of training and saving the model, add the following code to save the epoch, model, and optimizer information to the checkpoint file.
checkpoint = {
'epoch': epoch,
'model': model.state_dict(),
'optimizer': optimizer.state_dict(),
}
torch.save(checkpoint,'checkpoint')
This method also supports the tensorboardX visualized breakpoint continuation graph, but it will generate an extra log file, which only records the situation after the breakpoint. The data after the breakpoint will continue to be recorded in the original log file.
from transgan.
Related Issues (15)
- Maybe you can tell how to train it HOT 1
- Hi, I found that hinge loss doesn't work well, is that right? HOT 2
- GPU memory, Modifying batch size HOT 10
- Is there a pre-trained model? HOT 3
- sir,I have a question about the DiffAug, the paper said they used the Data Augmentation to get excellent improvement. It is about translation, cutout, color. So, in your code, did you use the DiffAug? HOT 1
- Hello, I can't download the file fid_stats_cifar10_train.npz that you provided in readme! HOT 1
- when i train my own data , i meet FID score :nan ,what's wrong with it HOT 2
- TransGAN fid problem HOT 1
- Could you give me a pretrained model, please? HOT 1
- FID score: nan HOT 1
- Create your own FID stats file HOT 2
- How do you test on your own dataset with the checkpoint.pth generated?
- question about argumentation
- Questions about multi-GPU training
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 transgan.