lernapparat / lernapparat Goto Github PK
View Code? Open in Web Editor NEWVarious Notebooks for Lernapparat.de
Various Notebooks for Lernapparat.de
Hi,
Thanks for releasing this code, it is helpful for me. But when i use a same noise input to your implementation and the official one, i got two similar image but not exactly same.
Is this work covered by the MIT license? I understand that the NVIDIA model's won't be, but I was hoping the PyTorch code would be.
I am wondering if I can use Style-GAN to synthesis two faces as shown in style-GAN official website
https://user-images.githubusercontent.com/18519110/93667991-95d96900-fa81-11ea-994c-83b4be9d857a.png
Is there any implementation for that in Pytorch
Do you have any thoughts of implementing stylegan2?
Currently, the lines
if 1:
# this can be run to get the weights, but you need the reference implementation and weights
import dnnlib, dnnlib.tflib, pickle, torch, collections
dnnlib.tflib.init_tf()
weights = pickle.load(open('./karras2019stylegan-ffhq-1024x1024.pkl','rb'))
weights_pt = [collections.OrderedDict([(k, torch.from_numpy(v.value().eval())) for k,v in w.trainables.items()]) for w in weights]
torch.save(weights_pt, './karras2019stylegan-ffhq-1024x1024.pt')
which are required to turn the .pkl
file from the NVidia page into a .pt
file result in the following error in google colab:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-f1e13f565901> in <module>()
1 if 1:
2 # this can be run to get the weights, but you need the reference implementation and weights
----> 3 import dnnlib, dnnlib.tflib, pickle, torch, collections
4 dnnlib.tflib.init_tf()
5 weights = pickle.load(open('./karras2019stylegan-ffhq-1024x1024.pkl','rb'))
2 frames
/content/stylegan/dnnlib/tflib/tfutil.py in <module>()
32
33
---> 34 def shape_to_list(shape: Iterable[tf.Dimension]) -> List[Union[int, None]]:
35 """Convert a Tensorflow shape to a list of ints."""
36 return [dim.value for dim in shape]
AttributeError: module 'tensorflow' has no attribute 'Dimension'
this can be fixed by adding a cell before the referenced (if 1:
) cell with
!pip install tensorflow==1.13.1
import tensorflow as tf
print(tf.__version__) ## should be 1.13.1
in addition, there should be more guidance on
! git clone https://github.com/NVlabs/stylegan
needing to be called to use dnnlib
.
Hi,
When I attempt to train is model on GPU, it reports the error below, while it can be trained on CPU.
RuntimeError: Assertion
dWeight.isContiguous()' failed. at /opt/conda/conda-bld/pytorch_1532581333611/work/aten/src/THCUNN/generic/SpatialDepthwiseConvolution.cu:140`
Do you have any ideas about it?
pytorch 0.4.1
cuda 9.0
Apparently, the following line should be changed in the class "MyConv2d": x = F.conv_transpose2d(x, w, stride=2, padding=(w.size(-1)-1)//2)
should be instead x = F.conv_transpose2d(x, w, stride=2, padding=int(w.size(-1)-1)//2)
.
Hi,
Is there any way to obtain a pre-trained StyleGAN discriminator in the PyTorch implementation?
I try to use my own image like a cat which resolution is 512x512.But when I set the command args.resolution=512, g_all.load_state_dict() get wrong. The Pytorch weight is still the same as "./karras2019stylegan-ffhq-1024x1024.pt" when i run on resolution 1024x1024.
Below is the wrong information.
python encode_image.py --src_im cat.jpg --iteration 10 --resolution 512
Traceback (most recent call last):
File "encode_image.py", line 123, in
main()
File "encode_image.py", line 37, in main
g_all.load_state_dict(torch.load(args.weight_file, map_location=device))
File "/home/beryl/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Sequential:
Unexpected key(s) in state_dict: "g_synthesis.blocks.1024x1024.conv0_up.weight", "g_synthesis.blocks.1024x1024.conv0_up.bias", "g_synthesis.blocks.1024x1024.conv0_up.intermediate.kernel", "g_synthesis.blocks.1024x1024.epi1.top_epi.noise.weight", "g_synthesis.blocks.1024x1024.epi1.style_mod.lin.weight", "g_synthesis.blocks.1024x1024.epi1.style_mod.lin.bias", "g_synthesis.blocks.1024x1024.conv1.weight", "g_synthesis.blocks.1024x1024.conv1.bias", "g_synthesis.blocks.1024x1024.epi2.top_epi.noise.weight", "g_synthesis.blocks.1024x1024.epi2.style_mod.lin.weight", "g_synthesis.blocks.1024x1024.epi2.style_mod.lin.bias".
size mismatch for g_synthesis.torgb.weight: copying a param with shape torch.Size([3, 16, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1]).
Hi,
This code base lets us generate new samples, but it can't be used to train new models. Is there any possibility of you releasing that part of the pipeline as well?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.