Giter Club home page Giter Club logo

lernapparat's People

Contributors

t-vi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lernapparat's Issues

MIT License

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.

Notebooks require old tensorflow (on google colab).

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.

This model cannot train on GPU?

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

Change defintion of padding in "MyConv2d"

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).

StyleGAN discriminator?

Hi,

Is there any way to obtain a pre-trained StyleGAN discriminator in the PyTorch implementation?

can not encode another resolution image except 1024x1024

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]).

Code for training models?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.