Various GANs for playing around
utkd / gans Goto Github PK
View Code? Open in Web Editor NEWVarious GANs for playing around
Various GANs for playing around
Hello, when I try to run the codes to create the GAN model, I receive an error saying that I am unable to create a Session. Appreciate any help :)
InternalError Traceback (most recent call last)
in ()
3 disc_condition_input = Input(shape=(10,))
4
----> 5 discriminator, disc_out = get_discriminator(img_input, disc_condition_input)
6 discriminator.compile(optimizer=Adam(0.0002, 0.5), loss='binary_crossentropy', metrics=['accuracy'])
7
in get_discriminator(input_layer, condition_layer)
1 def get_discriminator(input_layer, condition_layer):
2 hid = Conv2D(128, kernel_size=3, strides=1, padding='same')(input_layer)
----> 3 hid = BatchNormalization(momentum=0.9)(hid)
4 hid = LeakyReLU(alpha=0.1)(hid)
5
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/engine/base_layer.py in call(self, inputs, **kwargs)
458 # Actually call the layer,
459 # collecting output(s), mask(s), and shape(s).
--> 460 output = self.call(inputs, **kwargs)
461 output_mask = self.compute_mask(inputs, previous_mask)
462
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/layers/normalization.py in call(self, inputs, training)
181 normed_training, mean, variance = K.normalize_batch_in_training(
182 inputs, self.gamma, self.beta, reduction_axes,
--> 183 epsilon=self.epsilon)
184
185 if K.backend() != 'cntk':
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in normalize_batch_in_training(x, gamma, beta, reduction_axes, epsilon)
1833 """
1834 if ndim(x) == 4 and list(reduction_axes) in [[0, 1, 2], [0, 2, 3]]:
-> 1835 if not _has_nchw_support() and list(reduction_axes) == [0, 2, 3]:
1836 return _broadcast_normalize_batch_in_training(x, gamma, beta,
1837 reduction_axes,
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in _has_nchw_support()
287 """
288 explicitly_on_cpu = _is_current_explicit_device('CPU')
--> 289 gpus_available = len(_get_available_gpus()) > 0
290 return (not explicitly_on_cpu and gpus_available)
291
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in _get_available_gpus()
273 global _LOCAL_DEVICES
274 if _LOCAL_DEVICES is None:
--> 275 _LOCAL_DEVICES = get_session().list_devices()
276 return [x.name for x in _LOCAL_DEVICES if x.device_type == 'GPU']
277
~/.virtualenvs/jlenv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in get_session()
181 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
182 allow_soft_placement=True)
--> 183 _SESSION = tf.Session(config=config)
184 session = _SESSION
185 if not _MANUAL_VAR_INIT:
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in init(self, target, graph, config)
1561
1562 """
-> 1563 super(Session, self).init(target, graph, config=config)
1564 # NOTE(mrry): Create these on first __enter__
to avoid a reference cycle.
1565 self._default_graph_context_manager = None
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in init(self, target, graph, config)
631 if self._created_with_new_api:
632 # pylint: disable=protected-access
--> 633 self._session = tf_session.TF_NewSession(self._graph._c_graph, opts)
634 # pylint: enable=protected-access
635 else:
InternalError: Failed to create session.
I just ran this code on my gpu but did not get the similar images. actually the generated images are like random noise. And I also tried it on other dataset, but the accuracy of discriminator is always close to 0. I guess it is because of mode collapse, but you have used experience replay. I'm really confused now.
Hello, may I know why is the loss function binary_crossentropy instead of categorical_crossentropy?
When changing the output image size to 128x128, what should be changed in the code ...?
Could you share def generate_random_labels()?
In cifar10cgan.ipynb, the function "generate_random_labels" is missing.
Thank you for your helpful ipynb!
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.