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

Expected performance-2 #24

Closed axiniu closed 6 years ago

axiniu commented 6 years ago

Thank you for your work. After I tried some experiments,I met met some questions: For ciafr10,there are two search space and corresponding experiments:
----./scripts/cifar10_macro_search.sh ./scripts/cifar10_macro_final.sh ----./scripts/cifar10_micro_search.sh ./scripts/cifar10_micro_final.sh 1> ----I want to confirm the difference between the architectures produced by cifar10_macro_search.sh and cifar10_micro_search.sh. (one is ) 2> I found the architectures produced by cifar10_macro_search.sh like [1] [1 1] [5 0 0] [5 0 0 0] [0 0 1 1 0] [1 1 0 0 0 0] [1 1 0 1 1 1 0] [3 0 0 1 0 1 1 1] [5 0 0 1 0 0 1 0 0] [1 1 1 0 0 0 0 1 0 0] [0 1 1 0 0 0 0 1 1 1 1] [0 0 1 1 1 1 0 1 0 0 1 1], which has 12 cells,while in cifar10_macro_final.sh,the architecture is fixed_arc="0" fixed_arc="$fixed_arc 3 0" fixed_arc="$fixed_arc 0 1 0" fixed_arc="$fixed_arc 2 0 0 1" fixed_arc="$fixed_arc 2 0 0 0 0" fixed_arc="$fixed_arc 3 1 1 0 1 0" fixed_arc="$fixed_arc 2 0 0 0 0 0 1" fixed_arc="$fixed_arc 2 0 1 1 0 1 1 1" fixed_arc="$fixed_arc 1 0 1 1 1 0 1 0 1" fixed_arc="$fixed_arc 0 0 0 0 0 0 0 0 0 0" fixed_arc="$fixed_arc 2 0 0 0 0 0 1 0 0 0 0" fixed_arc="$fixed_arc 0 1 0 0 1 1 0 0 0 0 1 1" fixed_arc="$fixed_arc 2 0 1 0 0 0 0 0 1 0 1 1 0" fixed_arc="$fixed_arc 1 0 0 1 0 0 0 1 1 1 0 1 0 1" fixed_arc="$fixed_arc 0 1 1 0 1 0 1 0 0 0 0 0 1 0 0" fixed_arc="$fixed_arc 2 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1" fixed_arc="$fixed_arc 2 0 1 0 0 0 1 0 0 1 1 1 1 0 0 1 0" fixed_arc="$fixed_arc 2 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1" fixed_arc="$fixed_arc 3 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0" fixed_arc="$fixed_arc 3 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1" fixed_arc="$fixed_arc 0 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0" fixed_arc="$fixed_arc 3 0 1 0 1 1 0 0 1 0 1 1 0 1 1 0 1 0 0 1 0 0" fixed_arc="$fixed_arc 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0" fixed_arc="$fixed_arc 0 1 1 0 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0", which has 24 cells. So I want to konw where to get architecture like the one in cifar10_macro_final.sh. Thanks for you response.

axiniu commented 6 years ago

And when I take place of the architecture in cifar10_macro_final.sh. with an architecture produced by ./scripts/cifar10_macro_search.sh
fixed_arc="3" fixed_arc="$fixed_arc 0 0" fixed_arc="$fixed_arc 1 0 0" fixed_arc="$fixed_arc 3 1 0 0" fixed_arc="$fixed_arc 1 0 0 0 0" fixed_arc="$fixed_arc 1 1 0 0 0 0" fixed_arc="$fixed_arc 5 0 0 1 0 0 1" fixed_arc="$fixed_arc 4 1 1 1 1 1 1 0" fixed_arc="$fixed_arc 3 0 0 0 1 1 0 1 0" fixed_arc="$fixed_arc 4 1 0 0 1 0 1 1 0 0" fixed_arc="$fixed_arc 0 0 0 0 1 1 0 0 1 0 0" fixed_arc="$fixed_arc 5 0 0 1 0 1 0 0 0 0 0 0"

I got an error: Traceback (most recent call last): File "src/cifar10/main.py", line 360, in tf.app.run() File "/home/axi/anaconda3/envs/Efficient/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "src/cifar10/main.py", line 356, in main train() File "src/cifar10/main.py", line 224, in train ops = get_ops(images, labels) File "src/cifar10/main.py", line 191, in get_ops child_model.connect_controller(None) File "/home/axi/Efficient-2/enas-master/src/cifar10/general_child.py", line 705, in connect_controller self._build_train() File "/home/axi/Efficient-2/enas-master/src/cifar10/general_child.py", line 595, in _build_train logits = self._model(self.x_train, is_training=True) File "/home/axi/Efficient-2/enas-master/src/cifar10/general_child.py", line 212, in _model x = self._fixed_layer(layer_id, layers, start_idx, out_filters, is_training) File "/home/axi/Efficient-2/enas-master/src/cifar10/general_child.py", line 465, in _fixed_layer prev = res_layers + [out] UnboundLocalError: local variable 'out' referenced before assignment

hyhieu commented 6 years ago

Hi @axiniu,

Thank you for your interest in our work. To get a network with 24 layers, you need to change --child_num_layers from 12 to 24.

As for the error, we'll look into it and let you know.

hsl0529 commented 6 years ago

you just need to implement max pooling and average pooling