Giter Club home page Giter Club logo

ciphergan's Issues

Error in the Code

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.

How to run after training?

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?

KeyError: 'data/data_generators/tmp/data/vigenere_brown_vocab_200'

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'

ModuleNotFoundError: No module named '__main__.hparams'; '__main__' is not a package

Hello,I have a question to ask you. I hope you can help me solve it. I did the calculation according to your method, and the following problem occurred in the second step. I've tried my best to solve it, but I still can't.Questions as follows:

E:\WorkSpace\venv\Scripts\python.exe E:/WorkSpace/CipherGAN/train.py
Traceback (most recent call last):
File "E:/WorkSpace/CipherGAN/train.py", line 5, in
from .hparams.registry import get_hparams
ModuleNotFoundError: No module named 'main.hparams'; 'main' is not a package

Cannot output accuracy

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.

cipher GAN 交流

您好,我最近在研究cipher GAN,想和你相互交流一下。我的微信:loveanshen 我的QQ:519838354 期待您百忙中的回复!

Exception: Unsupported type: <class 'numpy.int32'>

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

Resuming Training?

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?

How to specify prediction_key for Metric

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

About the calculation of GP loss

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]?

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.