Comments (4)
Hello!
Wanted to know if anyone managed to convert model with custom layers from stylegan2 to onnx/torchscript serialization format?
Convert to torchscript demo:
In gpen_model.py, you should
1、add export_torchscript
attribute in __init__
of class Generator:
class Generator(nn.Module):
def __init__(
......
)
......
self.n_latent = self.log_size * 2 - 2
self.export_torchscript = False ## add export_torchscript attribute
def make_noise(self):
.....
2、add return image
in forward
of class Generator:
if return_latents:
return image, latent
elif self.export_torchscript: ##add by jnulzl
return image ##add by jnulzl
else:
return image, None
3、In the end of gpen_model.py
if __name__ == '__main__':
cpu_model = FullGenerator(512, 512, 8, 2).to(torch.device('cpu'))
cpu_model.generator.export_torchscript = True
data = torch.rand(1,3,512,512)
_ = cpu_model(data)
traced_cpu= torch.jit.trace(cpu_model, data)
torch.jit.save(traced_cpu, "FullGenerator_cpu.pt")
from gpen.
I will try it later.
from gpen.
I will try it later.
Hello,have you convert the stylegan2 to onnx/torchscript finally?
from gpen.
hi @jnulzl what the verson of onnx u install is?
from gpen.
Related Issues (20)
- why do you blur twice with the same guassian kernel?
- Training the Inpainting model
- Can it work on RGBA images?
- Have you tried with your FullGenerator_SR model?
- Confusing in the umeyama implementation. HOT 1
- Can't manage to find a download link for GPEN-BFR-2048 model. HOT 2
- about automatically rotated
- About the input resolution of "net_d.pt"
- TensorRT deployment HOT 3
- 部分人脸会出现磨皮很严重和人脸凭空出现黑痣的现象,有解决思路吗 HOT 1
- Unclear step (run codes) HOT 2
- 你好,发布一个可微调的GPEN-BFR-512模型吗?
- FullGenerator_SR
- eval lpips HOT 4
- Training results are normal, but test results abnormality HOT 1
- from face_detect.retinaface_detection import RetinaFaceDetection ModuleNotFoundError: No module named 'face_detect'
- why no weight_decay and scheduler for train_simple.py?
- How to convert FullGenerator to ONNX
- GPEN-BFR-2048 in ONNX format
- Adversarial Loss without any change at 0.69
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 gpen.