for-ai / ciphergan Goto Github PK
View Code? Open in Web Editor NEWTensorFlow implementation of CipherGAN
Home Page: https://openreview.net/forum?id=BkeqO7x0-
License: MIT License
TensorFlow implementation of CipherGAN
Home Page: https://openreview.net/forum?id=BkeqO7x0-
License: MIT License
C:\Users\caocao\Anaconda3\python.exe D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/train.py --output_dir=runs/vig345 \ --test_name=data/data_generators/tmp/data/vigenere345-brown200-eval* \ --train_name=data/data_generators/tmp/data/vigenere345-brown200-train* \ --hparam_sets=data/data_generators/tmp/data/vigenere_brown_vocab_200
Traceback (most recent call last):
File "D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/train.py", line 89, in
tf.app.run()
File "C:\Users\caocao\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/train.py", line 85, in main
_run_locally(FLAGS.train_steps, FLAGS.eval_steps)
File "D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/train.py", line 42, in _run_locally
hparams = get_hparams(FLAGS.hparam_sets)
File "D:\work\gan-pix2pix\CipherGAN-master\CipherGAN-master\hparams\registry.py", line 20, in get_hparams
curr = _HPARAMS[name]
KeyError: 'data/data_generators/tmp/data/vigenere_brown_vocab_200'
I have trained the network but I don't know how to run it. How would I use it to decrypt a text file or string?
File "D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/data/data_generators/cipher_generator.py", line 276, in
cipher_generator()
File "D:/work/gan-pix2pix/CipherGAN-master/CipherGAN-master/data/data_generators/cipher_generator.py", line 270, in cipher_generator
FLAGS.num_shards)
File "D:\work\gan-pix2pix\CipherGAN-master\CipherGAN-master\data\data_generators\generator_utils.py", line 44, in generate_files
sequence_example = to_example(case)
File "D:\work\gan-pix2pix\CipherGAN-master\CipherGAN-master\data\data_generators\generator_utils.py", line 19, in to_example
raise Exception("Unsupported type: %s" % type(v[0]))
Exception: Unsupported type: <class 'numpy.int32'>
Hi ~, I have run your code on my computer with default commands mentioned in README.md,
when I track the calculation of GP loss, I found a little bit confusing,
def wasserstein_penalty(discriminator, A_true, A_fake, params,
discriminator_params):
A_interp = sample_along_line(A_true, A_fake, params)
if params.use_embeddings:
A_interp = softmax_to_embedding(A_interp, params)
discrim_A_interp = discriminator(A_interp, discriminator_params, params)
discrim_A_grads = tf.gradients(discrim_A_interp, [A_interp])
if params.original_l2:
l2_loss = tf.sqrt(
tf.reduce_sum(
tf.convert_to_tensor(discrim_A_grads)**2, axis=[1, 2]))
if params.true_lipschitz:
loss = params.wasserstein_loss * tf.reduce_mean(
tf.nn.relu(l2_loss - 1)**2)
else:
loss = params.wasserstein_loss * tf.reduce_mean((l2_loss - 1)**2)
else:
loss = params.wasserstein_loss * (tf.nn.l2_loss(discrim_A_grads) - 1)**2
return loss
When the A_interp
has the shape [64, 100, 256], which can be annotated with [batch_size, seq_len, input_dim], and discrim_A_interp
has shape [64, 2, 1], then tf.convert_to_tensor(discrim_A_grads)
has shape [1, 64, 100, 256], but you apply reduce_sum
on it along axis [1,2] instead of axis [2,3]?
您好,我最近在研究cipher GAN,想和你相互交流一下。我的微信:loveanshen 我的QQ:519838354 期待您百忙中的回复!
Is there any way to resume the training basically when i loaded the data into the same directories with the checkpoints and the graph.pbtxt but still training command said CipherGAN.train is not an attribute for the python. What was the issue and the appropriate way to resume your training?
Hi!
When I run an example from the readme with Accuracy metric in addition to the default MSE, I get the following error:
ValueError: MetricSpec without specifiedValueError: MetricSpec without specified prediction_key requires predictions tensor or single element dict, got {'X': <tf.Tensor 'cycle_gan/transforms/G/Reshape_1:0' shape=(64, 100, 202) dtype=float32>, 'Y': <tf.Tensor 'cycle_gan/transforms/F/Reshape_1:0' shape=(64, 100, 202) dtype=float32>}
requires predictions tensor or single element dict, got {'X': <tf.Tensor 'cycle_gan/transforms/G/Reshape_1:0' shape=(64, 100, 202) dtype=float32>, 'Y': <tf.Tensor 'cycle_gan/transforms/F/Reshape_1:0' shape=(64, 100, 202) dtype=float32>}
How does the correct prediction_key specification for the README example look like?
Best,
Maksym
Hello,I encountered a problem.Following the operation of the README, the training was successful. However, the output is xy_mse, and I want to output the accuracy.Therefore, the xy_mse of the train.py file is changed to acc, But the accuracy cannot be output.
I get the following error:
ValueError:MetricSpec without specified prediction_key requires predictions tensor or single element dict, got {'X': <tf.Tensor 'cycle_gan/transforms/G/Reshape_1:0' shape=(64, 100, 202) dtype=float32>, 'Y': <tf.Tensor 'cycle_gan/transforms/F/Reshape_1:0' shape=(64, 100, 202) dtype=float32>}.
I look forward to your answer,best wishes,thank you.
The error arises when I run the start the training the flags of train.py where 1e4 and 1e2 are written they are seen as float values while int must be there otherwise the code gives the error. expecting the --train_steps to be an int or string. 1e4 and 1e2 must be changed to 10000 and 100 respectively so that the code starts running fine. Kindly update it.
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.