Code Monkey home page Code Monkey logo

igan's People

Contributors

junyanz 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  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

igan's Issues

Exception: ("We can't determine the cudnn version as it is not available",

I have installed cuda and cudnn, and I run THEANO_FLAGS='device=cpu, floatX=float32, nvcc.fastmath=True' /usr/bin/python iGAN_main.py --model_name outdoor_64, the error message is:

Traceback (most recent call last):
  File "iGAN_main.py", line 41, in <module>
    model = model_class.Model(model_name=args.model_name, model_file=args.model_file)
  File "/root/iGAN/model_def/dcgan_theano.py", line 27, in __init__
    self._gen = self.def_gen(self.gen_params, self.gen_batchnorm, n_layers=self.n_layers, n_f=self.n_f, nc=self.nc)
  File "/root/iGAN/model_def/dcgan_theano.py", line 40, in def_gen
    gx = gen_test(z, gen_params, gen_pl, n_layers=n_layers, n_f=n_f, nc=nc, use_tanh=False)
  File "/root/iGAN/model_def/dcgan_theano.py", line 227, in gen_test
    hout = relu(batchnorm(deconv(hin, w, subsample=(2, 2), border_mode=(2, 2)), u=u, s=s, g=g, b=b))
  File "/root/iGAN/lib/ops.py", line 95, in deconv
    d_img = GpuDnnConvGradI()(kerns, img, out, desc)
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/dnn.py", line 838, in __init__
    if version() < (4000, 4000):
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/__init__.py", line 407, in dnn_version
    dnn_available.msg)
Exception: ("We can't determine the cudnn version as it is not available", "Can not compile with cuDNN. We got this error:\nnvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).\n/usr/bin/ld: cannot find -lcudnn\ncollect2: error: ld returned 1 exit status\n")

Theano (0.8.2)
cuda (8.0)
cudnn(5.1)

image

envionment variable:
image

Thank you!

projecting an image onto the manifold?

Is the model for projecting an image back onto the manifold also packaged with the pre-trained models listed in the README? The code is organized very well and I've been able to use the Model class in ``dcgan_theano.pyto sample from the downloaded models, but I'm less clear how to do the inverse mappingx => z` through the projection model and optimization objective.

Will there be a PyTorch version soon?

Hello professor, I saw in an issue a few years ago that you mentioned that there would be a PyTorch version of this code, but a few days ago you replied that there was an iGAN improvement work, do you mean that there will be no PyTorch version of this code? I am very interested in iGAN and want to use it to do some work to complete my study, but Theano has stopped updating. It is not only difficult to read the code, but also incompatible with many versions when reproducing the code. If the PyTorch version of iGAN will be released in the near future, it will save a lot of time for my follow-up work.
Thanks!

Latest development: CycleGAN project

If you are interested in image editing and GANs, I would like to share with you our recent project CycleGAN for learning an image-to-image translation (i.e. pix2pix) without input-output pairs. Here are a few applications of the algorithm.

Cannot run cuda with version 8.0

Ubuntu16.04 GTX960 2G

Traceback (most recent call last):
File "iGAN_main.py", line 38, in
model_G = model_class.Model(model_name=args.model_name, model_file=args.model_file)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 24, in init
self._gen = self.def_gen(self.gen_params, self.gen_pl, self.n_layers, self.n_f)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 34, in def_gen
gx = gen_test(z, gen_params, gen_pl, n_layers=n_layers, n_f=n_f)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 319, in gen_test
hout = relu(batchnorm(deconv(hin, w, subsample=(2, 2), border_mode=(2, 2)), u=u, s=s, g=g, b=b))
File "/home/tzatter/iGAN/lib/ops.py", line 90, in deconv
img = gpu_contiguous(X)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 602, in call
node = self.make_node(_inputs, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 3963, in make_node
input = as_cuda_ndarray_variable(input)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 46, in as_cuda_ndarray_variable
return gpu_from_host(tensor_x)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 602, in call
node = self.make_node(_inputs, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 139, in make_node
dtype=x.dtype)()])
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/type.py", line 95, in init
(self.class.name, dtype, name))
TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None

Jun-Yan Zhu, thank you for the awesome code.

how to load an image?

As title, I saw the demo in youtube video, but however I can't find any way in GUI to load and image, any ideas?

PyTorch Version

Thank you for your excellent work. I believe this code will be more readable and extensible if in PyTorch. So will the PyTorch version be released? A link of third-party implementation is also fine, though I cannot find one for now.
Specifically, I'm interested in latent vector prediction and projection section.

TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None

I am running iGAN_main.py on Windows 10 with an NVIDIA GeForce GTX 980 with the following command

python iGAN_main.py --model_name outdoor_64

and have added the following lines to iGAN_main.py
import os
os.environ["THEANO_FLAGS"] = "device=gpu, floatX=float32, nvcc.fastmath=True"

and I receive the following error
TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None

I have also added these THEANO_FLAGS to the .theanorc file and still receive this error. I have upgraded Theano to 0.9. Can someone please help me with this issue? I am happy to provide whatever further information is needed to solve this issue.

Import issues

Traceback (most recent call last):
File "generate_samples.py", line 32, in
model_class = locate('model_def.%s' % args.model_type)
File "/usr/lib/python2.7/pydoc.py", line 1504, in locate
nextmodule = safeimport(join(parts[:n+1], '.'), forceload)
File "/usr/lib/python2.7/pydoc.py", line 341, in safeimport
raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in model_def.dcgan_theano - <type 'exceptions.ImportError'>: cannot import name raise_from

This is the error, I am getting. It would be great if you could help me out here.

pydoc ErrorDuringImport

When I run this python,
THEANO_FLAGS='device=cpu, floatX=float32, nvcc.fastmath=True' python iGAN_main.py --model_name outdoor_64

I got this error.

Traceback (most recent call last):
File "iGAN_main.py", line 40, in
model_class = locate('model_def.%s' % args.model_type)
File "/usr/lib/python2.7/pydoc.py", line 1521, in locate
nextmodule = safeimport(join(parts[:n+1], '.'), forceload)
File "/usr/lib/python2.7/pydoc.py", line 342, in safeimport
raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in model_def.dcgan_theano - <type 'exceptions.ImportError'>: No module named cuda.dnn

I already installed CUDA and cuDNN.
How can I run this code?
Thank you.

CPU only

Hi :) Thankyou for this repo!

Can I run the system on CPU alone?
If so, what are the necessary changes required?

I have tried changing the default config variables through THEANO_FLAGS - "device=cpu" and "config.device=cpu". But I get below issue. Is there a workaround to not use cudnn?

"Exception: ("We can't determine the cudnn version as it is not available", 'CUDA not available')"

Motion+Color flow algorithm

Hi!
Could you explain in detail the Motion+Color flow algorithm?
If there is a corresponding code that would be cool!

Training DCGAN will result in gray images

I am using train_dcgan.py to train the network over outdoor_64 images. However, after about 10 epochs of training, the generated images by the network become gray. Here is an example output file:
gen_00011

Any idea on what the problem could be?

Regarding the upcoming variational autoencoder feature

This is great stuff!

The README.md mentioned that there is a plan to support variational autoencoder, which I very much look forward to. My understanding is that the vanilla VAE tends to create blurry images (perhaps due to the disentangled representation that it learns), and I wonder if the planned VAE feature will be based on the vanilla VAE, or something like the autoencoding beyond pixels, or adversarial autoencoders?

train_dcgan.py error : Population must be a sequence or set.

I am trying to create my own dataset. I created the hdf5 file using the given script on the Readme, and now I want to launch the train_dcgan.py file on the hdf5 file. I also defined the model parameters in train_dcgan_config.py.

This is what I get after computing (hdf5 file's name is mickey_64) :

[model_name] = mickey_64
[ext] =
[data_file] = ../datasets/mickey_64.hdf5
[cache_dir] = ./cache/mickey_64/
[batch_size] = 128
[update_k] = 2
[save_freq] = 1
[lr] = 0.0002
[weight_decay] = 1e-05
[b1] = 0.5
./cache/mickey_64/web_dcgan/images
LOADING DATASET...
name = ../datasets/mickey_64.hdf5, ntrain = 884, ntest = 46
0.01 secs to load data
Traceback (most recent call last):
File "train_dcgan.py", line 66, in
vis_idxs = py_rng.sample(np.arange(len(test_x)), n_vis)
File "/home/aeon7/anaconda3/lib/python3.6/random.py", line 313, in sample
raise TypeError("Population must be a sequence or set. For dicts, use list(d).")
TypeError: Population must be a sequence or set. For dicts, use list(d).

I don't understand where this error comes from.

qdarkstyle issue (No module named qdarkstyle)

hi, i'm running this command after I have installed everything

iGAN2noui A$ THEANO_FLAGS='device=gpu0, floatX=float32, nvcc.fastmath=True' python iGAN_main.py --model_name outdoor_64

and get this error. everything is installed as you described. i tried it on macos and ubuntu. same error.

Traceback (most recent call last):
  File "iGAN_main.py", line 4, in <module>
    import qdarkstyle
ImportError: No module named qdarkstyle

from lib import activations

when I run your code, there is an error:
ImportError Traceback (most recent call last)
in ()
5
6 from theano.sandbox.cuda.dnn import dnn_conv
----> 7 from lib import activations
8 from lib import inits
9 from lib.ops import batchnorm, deconv

ImportError: cannot import name activations

what can I do to solve this? sorry to bother you with such a simple question but I am a new one, coud you please help me ?

About Theano version

Theano1.0 has changed the interface of the function-
image

The original interface was:
class GpuAllocEmpty(GpuOp);
but now:
class GpuAllocEmpty(HideC, AllocEmpty);

What should I do if I want to change to the corresponding interface?
Thank you.

Run the script error with message says 'cuda...'

Device Information

ThinkPad R400 with ArchLinux
my GPU is AMD rather than Nvidia.

Problem

when I exec

THEANO_FLAGS='device=gpu0, floatX=float32, nvcc.fastmath=True' python iGAN_main.py --model_name outdoor_64'

It says:

Traceback (most recent call last):
  File "iGAN_main.py", line 9, in <module>
    import constrained_opt
  File "/home/konjac/code/iGAN/constrained_opt.py", line 3, in <module>
    from lib.rng import np_rng
  File "/home/konjac/code/iGAN/lib/rng.py", line 2, in <module>
    from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
  File "/usr/lib/python3.6/site-packages/theano/__init__.py", line 67, in <module>
    from theano.configdefaults import config
  File "/usr/lib/python3.6/site-packages/theano/configdefaults.py", line 113, in <module>
    in_c_key=False)
  File "/usr/lib/python3.6/site-packages/theano/configparser.py", line 285, in AddConfigVar
    configparam.__get__(root, type(root), delete_key=True)
  File "/usr/lib/python3.6/site-packages/theano/configparser.py", line 333, in __get__
    self.__set__(cls, val_str)
  File "/usr/lib/python3.6/site-packages/theano/configparser.py", line 344, in __set__
    self.val = self.filter(val)
  File "/usr/lib/python3.6/site-packages/theano/configdefaults.py", line 100, in filter
    % (self.default, val, self.fullname)))
ValueError: Invalid value ("cpu") for configuration variable "gpu0". Valid options start with one of "device", "opencl", "cuda"

What should I do to solve this?
Is it caused because of my gpu brand? So is it possible to run this app on amd gpu?

ImportError in train_predict_z.py

When I run this script, the following error happens:
File "train_predict_z.py", line 19, in
from lib import AlexNet
File "../lib/AlexNet.py", line 1, in
from lasagne.layers import InputLayer, Conv2DLayer
File "/home/atlantix/.local/lib/python2.7/site-packages/lasagne/init.py", line 19, in
from . import layers
File "/home/atlantix/.local/lib/python2.7/site-packages/lasagne/layers/init.py", line 7, in
from .pool import *
File "/home/atlantix/.local/lib/python2.7/site-packages/lasagne/layers/pool.py", line 6, in
from theano.tensor.signal import downsample
ImportError: cannot import name downsample

I'm sure the version of theano and lasagne is the latest. And I have tried to reinstall lasagne but the error is still there. Is lasagne not working?
Thanks.

error on training my own data set

I am trying to train my own data set. For starting I prepared 1000 pictures and made an hdf5 file based on 64*64. After that I ran the train_dcgan.py file I had an error and I had to modify the n_vis parameter manually to 10 in train_dcgan.py to get it work. But after that I had a new error which I have paste it here:

Traceback (most recent call last):
File "train_dcgan.py", line 71, in
grid_real = utils.grid_vis((vaX_vis*255.0).astype(np.uint8), n_grid, n_grid)
File "../lib/utils.py", line 138, in grid_vis
img[j * h:j * h + h, i * w:i * w + w, :] = x
ValueError: could not broadcast input array from shape (64,64,3) into shape (0,64,3)

I would be very appreciated if you have any suggestions.

Code compilation

What would you recommend for someone who's running this code now? What should I install?
I am asking this because theano backend has been changed and on running the given code now, I am getting numerous errors related to the same.

Do give some suggestions in this matter.

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.