melodyguan / enas

TensorFlow Code for paper "Efficient Neural Architecture Search via Parameter Sharing"
https://arxiv.org/abs/1802.03268
Apache License 2.0
1.58k stars 390 forks source link

undefined name 'ch_mul' #2

Closed cclauss closed 6 years ago

cclauss commented 6 years ago

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./src/utils.py:34:11: E999 SyntaxError: invalid syntax
  print "-" * 80
          ^
./src/cifar10/controller.py:39:13: E999 SyntaxError: invalid syntax
    print "-" * 80
            ^
./src/cifar10/data_utils.py:17:19: E999 SyntaxError: invalid syntax
    print file_name
                  ^
./src/cifar10/general_child.py:510:74: F821 undefined name 'ch_mul'
            "w_depth", [self.filter_size, self.filter_size, out_filters, ch_mul])
                                                                         ^
./src/cifar10/general_child.py:511:67: F821 undefined name 'ch_mul'
          w_point = create_weight("w_point", [1, 1, out_filters * ch_mul, count])
                                                                  ^
./src/cifar10/general_child.py:582:51: F821 undefined name 'avg_or_pool'
        raise ValueError("Unknown pool {}".format(avg_or_pool))
                                                  ^
./src/cifar10/general_controller.py:46:13: E999 SyntaxError: invalid syntax
    print "-" * 80
            ^
./src/cifar10/models.py:45:13: E999 SyntaxError: invalid syntax
    print "-" * 80
            ^
./src/ptb/main.py:310:30: F821 undefined name 'xrange'
              for ct_step in xrange(FLAGS.controller_train_steps *
                             ^
./src/ptb/main.py:339:24: F821 undefined name 'xrange'
              for _ in xrange(10):
                       ^
./src/ptb/ptb_enas_child.py:170:44: F821 undefined name 'eval_set'
    print("{}_total_loss: {:<6.2f}".format(eval_set, total_loss))
                                           ^
./src/ptb/ptb_enas_child.py:171:41: F821 undefined name 'eval_set'
    print("{}_log_ppl: {:<6.2f}".format(eval_set, log_ppl))
                                        ^
./src/ptb/ptb_enas_child.py:172:37: F821 undefined name 'eval_set'
    print("{}_ppl: {:<6.2f}".format(eval_set, ppl))
                                    ^
./src/ptb/ptb_enas_controller.py:74:25: F821 undefined name 'xrange'
        for layer_id in xrange(self.lstm_num_layers):
                        ^
./src/ptb/ptb_enas_controller.py:104:14: F821 undefined name 'xrange'
    for _ in xrange(self.lstm_num_layers):
             ^
./src/ptb/ptb_enas_controller.py:109:21: F821 undefined name 'xrange'
    for layer_id in xrange(self.rhn_depth):
                    ^
./src/ptb/ptb_enas_controller.py:217:47: F821 undefined name 'critic_train_op'
      self.train_op = tf.group(self.train_op, critic_train_op)
                                              ^
5     E999 SyntaxError: invalid syntax
12    F821 undefined name 'ch_mul'
17
hyhieu commented 6 years ago

Thanks for the ch_mul issue. We have fixed that.

Other syntax errors seem to be Python2 / Python3 problems. All files were updated too.

cclauss commented 6 years ago

On Python 2...

flake8 testing of https://github.com/melodyguan/enas on Python 2.7.14

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./src/cifar10/general_child.py:581:51: F821 undefined name 'avg_or_pool'
        raise ValueError("Unknown pool {}".format(avg_or_pool))
                                                  ^
./src/ptb/ptb_enas_child.py:170:44: F821 undefined name 'eval_set'
    print("{}_total_loss: {:<6.2f}".format(eval_set, total_loss))
                                           ^
./src/ptb/ptb_enas_child.py:171:41: F821 undefined name 'eval_set'
    print("{}_log_ppl: {:<6.2f}".format(eval_set, log_ppl))
                                        ^
./src/ptb/ptb_enas_child.py:172:37: F821 undefined name 'eval_set'
    print("{}_ppl: {:<6.2f}".format(eval_set, ppl))
                                    ^
./src/ptb/ptb_enas_controller.py:217:47: F821 undefined name 'critic_train_op'
      self.train_op = tf.group(self.train_op, critic_train_op)
                                              ^
5     F821 undefined name 'avg_or_pool'
hyhieu commented 6 years ago

Thanks again 👍 These issues have been fixed.

cclauss commented 6 years ago

critic_train_op issue still exists.

hyhieu commented 6 years ago

Fixed ^_^