Giter VIP home page Giter VIP logo

shaohua0116 / demo2program Goto Github PK

View Code? Open in Web Editor NEW
101.0 10.0 24.0 16.64 MB

An official TensorFlow implementation of "Neural Program Synthesis from Diverse Demonstration Videos" (ICML 2018) by Shao-Hua Sun, Hyeonwoo Noh, Sriram Somasundaram, and Joseph J. Lim

Home Page: https://shaohua0116.github.io/demo2program/

License: MIT License

Python 99.63% Shell 0.37%
program-synthesis deep-learning video-analysis icml-2018 icml

demo2program's Introduction

Neural Program Synthesis from Diverse Demonstration Videos

Descriptions

This project is a TensorFlow implementation of Neural Program Synthesis from Diverse Demonstration Videos, which is published in ICML 2018. We provide codes and checkpoints for our model and all baselines presented in the paper. Also, we provide scripts and codes for generating datasets as well as the datasets we used to train and test all models.

As interpreting decision making logic in demonstration videos is key to collaborating with and mimicking humans, our goal is to empower machines with this ability. To this end, we propose a neural program synthesizer that is able to explicitly synthesize underlying programs from behaviorally diverse and visually complicated demonstration videos, as illustrated in the following figure.

We introduce a summarizer module as part of our model to improve the network’s ability to integrate multiple demonstrations varying in behavior. We also employ a multi-task objective to encourage the model to learn meaningful intermediate representations for end-to-end training. Our proposed model consists three components:

  • Demonstration Encoder receives a demonstration video as input and produces an embedding that captures an agent’s actions and perception.
  • Summarizer Module discovers and summarizes where actions diverge between demonstrations and upon which branching conditions subsequent actions are taken.
  • Program Decoder represents the summarized understanding of demonstrations as a code sequence.

The illustration of the overall architecture is as follows. For more details, please refer to the paper.

Our method is evaluated on a fully observable, third-person environment (Karel environment) and a partially observable, egocentric game (ViZDoom environment). We show that our model is able to reliably synthesize underlying programs as well as capture diverse behaviors exhibited in demonstrations.

*This code is still being developed and subject to change.

Directories

The structure of the repository:

  • ./: training and evaluation scripts
  • ./models: network models used for the experiments
  • ./karel_env: karel environment including dsl, interpreter and dataset generator / loader
  • ./vizdoom_env: vizdoom environment including dsl, interpreter and dataset generator / loader

Prerequisites

Datasets

Karel environment

  • You can find the codes for the Karel environments in this directory
  • To generate a dataset for Karel environments including programs and demonstrations, use the following script.
./karel_env/generate_dataset.sh

Default arguments are identical to the settings described in the paper.

ViZDoom environment

  • To reproduce experiments in our paper, you need to install our deterministic ViZDoom envrionment
  • You can find the codes for the ViZDoom environments and detailed instructions in this directory
  • To generate a dataset (vizdoom_dataset, vizdoom_dataset_ifelse) for the ViZDoom environment including programs and demonstrations, use the following script.
./vizdoom_env/generate_dataset.sh

Usage

Training

  • Train the full model (with the summarizer module and the multi-task objective)
python trainer.py --model full --dataset_path /path/to/the/dataset/ --dataset_type [karel/vizdoom]
  • Train the summarizer model (with the summarizer module but without multi-task objective)
python trainer.py --model summarizer --dataset_path /path/to/the/dataset/ --dataset_type [karel/vizdoom]
  • Train the baseline program synthesis model (without the summarizer module and multi-task objective)
python trainer.py --model synthesis_baseline --dataset_path /path/to/the/dataset/ --dataset_type [karel/vizdoom]
  • Train the baseline program induction model
python trainer.py --model induction_baseline --dataset_path /path/to/the/dataset/ --dataset_type [karel/vizdoom]
  • Arguments
    • --debug: set to True to see debugging visualization (LSTM masks, etc.)
    • --prefix: a nickname for the training
    • --model: specify which type of models to train/test
    • --dataset_type: choose between karel and vizdoom. You can also add your own datasets.
    • --dataset_path: specify the path to the dataset where you can find a HDF5 file and a .txt file
    • --checkpoint: specify the path to a pre-trained checkpoint
    • Logging
      • --log_setp: the frequency of outputing log info ([train step 681] Loss: 0.51319 (1.896 sec/batch, 16.878 instances/sec))
      • --write_summary_step: the frequency of writing TensorBoard summaries (default 100)
      • --test_sample_step: the frequency of performing testing inference during training (default 100)
    • Hyperparameters
      • --num_k: the number of seen demonstrations (default 10)
      • --batch_size: the mini-batch size (default 32)
      • --learning_rate: the learning rate (default 1e-3)
      • --lr_weight_decay: set to True to perform expotential weight decay on the learning rate
      • --scheduled_sampling: set to True to train models with scheduled sampling
    • Architecture
      • --encoder_rnn_type: the recurrent model of the demonstration encoder. Choices include RNN, GRU, and LSTM
      • --num_lstm_cell_units: the size of RNN/GRU/LSTM hidden layers (default 512)
      • --demo_aggregation: how to aggregate the demo features (default average pooling) for synthesis and induction baseline

Testing

  • Evaluate trained models
python evaler.py --model [full/synthesis_baseline/summarizer/induction_baseline] --dataset_path /path/to/the/dataset/ --dataset_type [karel/vizdoom] [--train_dir /path/to/the/training/dir/ OR --checkpoint /path/to/the/trained/model]

Reproducing result on VizDoom dataset

Because the size of the demonstrations in VizDoom is usually very large, it is difficult to use large batch size and results in very slow training. To circumvent this issue, we used two stage training; we pretrain our model with short demonstrations first and then finetune the model with the whole dataset. For the first stage of the training, we used batch size: 32, and for the second stage of the training, we used batch size: 8. Here are links to datasets that we used for the first and second stage of the training:

To reproduce our result, you can train and evaluate models with the following command:

  • First stage: training for 50000 iterations
python trainer.py --model full --dataset_path path_to_vizdoom_shorter --dataset_type vizdoom --num_k 25 --batch_size 32
  • Second stage: training for 50000 iterations
python trainer.py --model full --dataset_path path_to_vizdoom_full --dataset_type vizdoom --num_k 25 --batch_size 8 --checkpoint path_to_1st_step_checkpoint

For evaluation, use the following command:

python evaler.py --model full --dataset_path path_to_vizdoom_full --dataset_type vizdoom --num_k 25 --checkpoint path_to_2nd_step_checkpoint

Results

Karel environment

Methods Execution Program Sequence
Induction baseline 62.8% - -
Synthesis baseline 64.1% 42.4% 35.7%
+ summarizer (ours) 68.6% 45.3% 38.3%
+ multi-task loss (ours-full) 72.1% 48.9% 41.0%
  • Effect of the summarizer module

To verify the effectiveness of our proposed summarizer module, we conduct experiments where models are trained on varying numbers of demonstrations (k) and compare the execution accuracy.

Methods k=3 k=5 k=10
Synthesis baseline 58.5% 60.1% 64.1%
+ summarizer (ours) 60.6% 63.1% 68.6%

ViZDoom environment

Methods Execution Program Sequence
Induction baseline 35.1% - -
Synthesis baseline 48.2% 39.9% 33.1%
Ours-full 78.4% 62.5% 53.2%
  • If-else experiment:

To verify the importance of inferring underlying conditions, we perform evaluation only with programs containing a single if-else statement with two branching consequences. This setting is sufficiently simple to isolate other diverse factors that might affect the evaluation result.

Methods Execution Program Sequence
Induction baseline 26.5% - -
Synthesis baseline 59.9% 44.4% 36.1%
Ours-full 89.4% 69.1% 58.8%
  • Generalization over different number of seen demonstrations

The baseline models and our model trained with 25 seen demonstration are evaluated with fewer or more seen demonstrations.

Download datasets and checkpoints

To reproduce our results, you can download our datasets and checkpoints.

Datasets

While we provide the scripts and codes for generating customized datasets, we also made the datasets we used to train and test our models and baselines available.

  • Karel (13GB) [link]
    • For the main Karel experiment (Table 1) and the summarizer experiment (Table 2)
  • ViZDoom full (505GB) [link]
    • For the main ViZDoom experiment (Table 3) and the ViZDoom generalization experiment (Figure 7)
    • ViZDoom shorter (248GB) [link]
      • A subset of the Vizdoom full datsaet where only the shorter demos are included
  • ViZDoom if-else (40GB) [link]
    • For the ViZDoom if-else experiment (Table 4)

Checkpoints

We provide checkpoints and evaluation report files of our models and baselines for all experiments.

  • Karel main experiment (Table 1) [link]
  • Karel summarizer experiment (Table 2) [link]
  • ViZDoom main experiment (Table 3 and Figure 7) [link]
  • ViZDoom if-else experiment (Table 4) [link]

Related work

Neural Program Synthesis

Neural Program Induction

Misc

Cite the paper

If you find this useful, please cite

@inproceedings{sun2018neural,
    title = {Neural Program Synthesis from Diverse Demonstration Videos},
    author = {Sun, Shao-Hua and Noh, Hyeonwoo and Somasundaram, Sriram and Lim, Joseph},
    booktitle = {Proceedings of the 35th International Conference on Machine Learning},
    year = {2018},
}

Authors

Shao-Hua Sun*, Hyeonwoo Noh*, Sriram Somasundaram, and Joseph J. Lim

(*Equal contribution)

demo2program's People

Contributors

hyeonwoonoh avatar shaohua0116 avatar srirams32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

demo2program's Issues

problem running code

Hi, I liked your paper and was interested in trying out your code.
i'm having a problem running the data synthesis:
python trainer.py --model synthesis_baseline --dataset_path /my_path/demo2program/datasets/karel_dataset/ --dataset_type karel

first error was a typo on line 249 of trainer.py "defiault="

second error is harder to diagnose:
demo2program$ python trainer.py --model synthesis_baseline --dataset_path /home/h/demo2program/datasets/karel_dataset/ --dataset_type karel
[2018-09-12 15:18:17,938] Reading /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5 ...
[2018-09-12 15:18:17,939] Reading Done: /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5
[2018-09-12 15:18:17,939] Reading /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5 ...
[2018-09-12 15:18:17,940] Reading Done: /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5
[2018-09-12 15:18:17,940] Reading /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5 ...
[2018-09-12 15:18:17,941] Reading Done: /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/data.hdf5
[2018-09-12 15:18:17,944] Train Dir: ./train_dir/karel-home_disele_Documents_PROJ_program_synth_demo2program_datasets_karel_dataset-synthesis_baseline-default-bs_32_lr_0.001_lstm_cell_512_k_10-20180912-151817
[2018-09-12 15:18:17,944] input_ops [inputs]: Using 25000 IDs from dataset
[2018-09-12 15:18:18,036] input_ops [inputs]: Using 5000 IDs from dataset
[2018-09-12 15:18:18,078] Using Model class: <class 'models.baselines.model_synthesis.Model'>
[2018-09-12 15:18:18,181] Demo_Encoder
[2018-09-12 15:18:18,183] Demo_Encoder/State_Encoder
[2018-09-12 15:18:18,229] conv1 Tensor("Demo_Encoder/State_Encoder/conv1/bn_act/BatchNorm/batchnorm/add_1:0", shape=(640, 4, 4, 16), dtype=float32)
[2018-09-12 15:18:18,274] conv2 Tensor("Demo_Encoder/State_Encoder/conv2/bn_act/BatchNorm/batchnorm/add_1:0", shape=(640, 2, 2, 32), dtype=float32)
[2018-09-12 15:18:18,320] conv3 Tensor("Demo_Encoder/State_Encoder/conv3/bn_act/BatchNorm/batchnorm/add_1:0", shape=(640, 1, 1, 48), dtype=float32)
[2018-09-12 15:18:18,425] Tensor("Demo_Encoder/rnn/transpose:0", shape=(32, 20, 512), dtype=float32)
[2018-09-12 15:18:20,184] Program_Decoder/Token_Embedding
Successfully loaded the model.
[2018-09-12 15:18:21,059] ********* var **********

Variables: name (type shape) [size]

Demo_Encoder/State_Encoder/conv1/Conv/weights:0 (float32_ref 3x3x16x16) [2304, bytes: 9216]
Demo_Encoder/State_Encoder/conv1/Conv/biases:0 (float32_ref 16) [16, bytes: 64]
Demo_Encoder/State_Encoder/conv1/bn_act/BatchNorm/beta:0 (float32_ref 16) [16, bytes: 64]
Demo_Encoder/State_Encoder/conv1/bn_act/BatchNorm/gamma:0 (float32_ref 16) [16, bytes: 64]
Demo_Encoder/State_Encoder/conv2/Conv/weights:0 (float32_ref 3x3x16x32) [4608, bytes: 18432]
Demo_Encoder/State_Encoder/conv2/Conv/biases:0 (float32_ref 32) [32, bytes: 128]
Demo_Encoder/State_Encoder/conv2/bn_act/BatchNorm/beta:0 (float32_ref 32) [32, bytes: 128]
Demo_Encoder/State_Encoder/conv2/bn_act/BatchNorm/gamma:0 (float32_ref 32) [32, bytes: 128]
Demo_Encoder/State_Encoder/conv3/Conv/weights:0 (float32_ref 3x3x32x48) [13824, bytes: 55296]
Demo_Encoder/State_Encoder/conv3/Conv/biases:0 (float32_ref 48) [48, bytes: 192]
Demo_Encoder/State_Encoder/conv3/bn_act/BatchNorm/beta:0 (float32_ref 48) [48, bytes: 192]
Demo_Encoder/State_Encoder/conv3/bn_act/BatchNorm/gamma:0 (float32_ref 48) [48, bytes: 192]
Demo_Encoder/rnn/basic_lstm_cell/kernel:0 (float32_ref 560x2048) [1146880, bytes: 4587520]
Demo_Encoder/rnn/basic_lstm_cell/bias:0 (float32_ref 2048) [2048, bytes: 8192]
Program_Decoder/Token_Embedding/embedding_map:0 (float32_ref 51x512) [26112, bytes: 104448]
Program_Decoder/dynamic_decoder/basic_lstm_cell/kernel:0 (float32_ref 1024x2048) [2097152, bytes: 8388608]
Program_Decoder/dynamic_decoder/basic_lstm_cell/bias:0 (float32_ref 2048) [2048, bytes: 8192]
Program_Decoder/dynamic_decoder/output_projection/kernel:0 (float32_ref 512x50) [25600, bytes: 102400]
Total size of variables: 3320864
Total bytes of variables: 13283456
2018-09-12 15:18:33.107136: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-09-12 15:18:33.107163: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-09-12 15:18:33.107168: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-09-12 15:18:33.107172: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-09-12 15:18:33.107176: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
[2018-09-12 15:18:49,161] dataset: /home/disele/Documents/PROJ_program_synth/demo2program/datasets/karel_dataset/, learning_rate: 0.001000
[2018-09-12 15:18:49,162] Training Starts!
{'a_h': <tf.Tensor 'shuffle_batch:0' shape=(32, 10, 20, 6) dtype=float32>,
'a_h_tokens': <tf.Tensor 'shuffle_batch:1' shape=(32, 10, 20) dtype=int32>,
'demo_len': <tf.Tensor 'shuffle_batch:2' shape=(32, 10) dtype=float32>,
'id': <tf.Tensor 'shuffle_batch:3' shape=(32,) dtype=string>,
'per': <tf.Tensor 'shuffle_batch:4' shape=(32, 10, 20, 5) dtype=float32>,
'program': <tf.Tensor 'shuffle_batch:5' shape=(32, 50, 43) dtype=float32>,
'program_len': <tf.Tensor 'shuffle_batch:6' shape=(32, 1) dtype=float32>,
'program_tokens': <tf.Tensor 'shuffle_batch:7' shape=(32, 43) dtype=int32>,
's_h': <tf.Tensor 'shuffle_batch:8' shape=(32, 10, 20, 8, 8, 16) dtype=float32>,
'test_a_h': <tf.Tensor 'shuffle_batch:9' shape=(32, 5, 20, 6) dtype=float32>,
'test_a_h_tokens': <tf.Tensor 'shuffle_batch:10' shape=(32, 5, 20) dtype=int32>,
'test_demo_len': <tf.Tensor 'shuffle_batch:11' shape=(32, 5) dtype=float32>,
'test_per': <tf.Tensor 'shuffle_batch:12' shape=(32, 5, 20, 5) dtype=float32>,
'test_s_h': <tf.Tensor 'shuffle_batch:13' shape=(32, 5, 20, 8, 8, 16) dtype=float32>}
Traceback (most recent call last):
File "trainer.py", line 344, in
main()
File "trainer.py", line 341, in main
trainer.train()
File "trainer.py", line 164, in train
self.batch_train, step=s, is_train=True)
File "trainer.py", line 199, in run_single_step
fetch_values = self.session.run(fetch, feed_dict=feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 895, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1321, in _do_run
options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,0] = 51 is not in [0, 51)
[[Node: Program_Decoder/embedding_lookup = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@Program_Decoder/Token_Embedding/embedding_map"], validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Program_Decoder/Token_Embedding/embedding_map/read, Program_Decoder/concat)]]

Caused by op u'Program_Decoder/embedding_lookup', defined at:
File "trainer.py", line 344, in
main()
File "trainer.py", line 337, in main
trainer = Trainer(config, dataset_train, dataset_test)
File "trainer.py", line 80, in init
global_step=self.global_step)
File "/home/disele/Documents/PROJ_program_synth/demo2program/models/baselines/model_synthesis.py", line 187, in init
self.build(is_train=is_train)
File "/home/disele/Documents/PROJ_program_synth/demo2program/models/baselines/model_synthesis.py", line 475, in build
embedding_dim=embedding_dim, scope='Program_Decoder', reuse=False
File "/home/disele/Documents/PROJ_program_synth/demo2program/models/baselines/model_synthesis.py", line 417, in LSTM_Decoder
unroll_type=unroll_type)
File "/home/disele/Documents/PROJ_program_synth/demo2program/models/baselines/model_synthesis.py", line 365, in get_DecoderHelper
embedding = embedding_lookup(gt_tokens)
File "/home/disele/Documents/PROJ_program_synth/demo2program/models/baselines/model_synthesis.py", line 280, in embedding_lookup
embedding = tf.nn.embedding_lookup(embedding_map, t)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/embedding_ops.py", line 294, in embedding_lookup
transform_fn=None)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/embedding_ops.py", line 123, in _embedding_lookup_and_transform
result = _gather_and_clip(params[0], ids, max_norm, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/embedding_ops.py", line 57, in _gather_and_clip
embs = array_ops.gather(params, ids, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 2409, in gather
validate_indices=validate_indices, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 1219, in gather
validate_indices=validate_indices, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): indices[0,0] = 51 is not in [0, 51)
[[Node: Program_Decoder/embedding_lookup = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@Program_Decoder/Token_Embedding/embedding_map"], validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Program_Decoder/Token_Embedding/embedding_map/read, Program_Decoder/concat)]]

2018-09-12 15:19:03.408287: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
2018-09-12 15:19:03.408381: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'float32'
Exception in thread Thread-8 (most likely raised during interpreter shutdown):2018-09-12 15:19:03.408733: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
Exception in thread Thread-25 (most likely raised during interpreter shutdown):Exception in thread Thread-31 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
2018-09-12 15:19:03.409015: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 754, in run
Traceback (most recent call last):

File "/usr/lib/python2.7/threading.py", line 754, in run File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run2018-09-12 15:19:03.409400: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run2018-09-12 15:19:03.409550: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'zeros'
File "/usr/lib/python2.7/weakref.py", line 330, in getitem
<type 'exceptions.TypeError'>: 'NoneType' object is not callable2018-09-12 15:19:03.409657: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
Exception in thread Thread-32 (most likely raised during interpreter shutdown):
2018-09-12 15:19:03.409740: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/lib/python2.7/weakref.py", line 330, in __getitem__Exception in thread Thread-12 (most likely raised during interpreter shutdown):Exception in thread Thread-9 (most likely raised during interpreter shutdown):

<type 'exceptions.TypeError'>: 'NoneType' object is not callableException in thread Thread-36 (most likely raised during interpreter shutdown):

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
Exception in thread Thread-24 (most likely raised during interpreter shutdown):Traceback (most recent call last):

2018-09-12 15:19:03.410391: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'PY3'
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

File "/usr/lib/python2.7/weakref.py", line 330, in __getitem__Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner2018-09-12 15:19:03.410502: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

Exception in thread Thread-7 (most likely raised during interpreter shutdown):
File "/usr/lib/python2.7/threading.py", line 754, in run2018-09-12 15:19:03.410732: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/threading.py", line 754, in runTraceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_innerTraceback (most recent call last):

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 754, in run

2018-09-12 15:19:03.410855: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _runException in thread Thread-16 (most likely raised during interpreter shutdown):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _runException in thread Thread-19 (most likely raised during interpreter shutdown):
Traceback (most recent call last):

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _runException in thread Thread-27 (most likely raised during interpreter shutdown):

File "/usr/lib/python2.7/threading.py", line 754, in run

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_innerTraceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/weakref.py", line 330, in getitem
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
File "/usr/lib/python2.7/threading.py", line 754, in run File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

File "/usr/lib/python2.7/weakref.py", line 330, in getitem File "/usr/lib/python2.7/weakref.py", line 330, in getitem
File "/usr/lib/python2.7/weakref.py", line 330, in getitem
2018-09-12 15:19:03.411391: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run<type 'exceptions.TypeError'>: 'NoneType' object is not callable
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/weakref.py", line 330, in getitem File "/usr/lib/python2.7/weakref.py", line 330, in __getitem__2018-09-12 15:19:03.411567: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

<type 'exceptions.TypeError'>: 'NoneType' object is not callable
File "/usr/lib/python2.7/weakref.py", line 330, in getitem
File "/usr/lib/python2.7/weakref.py", line 330, in getitem

<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Exception in thread Thread-11 (most likely raised during interpreter shutdown): File "/usr/lib/python2.7/weakref.py", line 330, in getitem<type 'exceptions.TypeError'>: 'NoneType' object is not callable
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

Traceback (most recent call last):

<type 'exceptions.TypeError'>: 'NoneType' object is not callable File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner<type 'exceptions.TypeError'>: 'NoneType' object is not callable
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
File "/usr/lib/python2.7/threading.py", line 754, in run2018-09-12 15:19:03.412149: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
Exception in thread Thread-20 (most likely raised during interpreter shutdown):

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

File "/usr/lib/python2.7/weakref.py", line 330, in getitem
2018-09-12 15:19:03.416161: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
Traceback (most recent call last):Exception in thread Thread-37 (most likely raised during interpreter shutdown):
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
2018-09-12 15:19:03.416298: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

Exception in thread Thread-30 (most likely raised during interpreter shutdown):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner2018-09-12 15:19:03.416570: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'PY3'
Exception in thread Thread-18 (most likely raised during interpreter shutdown):
Exception in thread Thread-6 (most likely raised during interpreter shutdown):2018-09-12 15:19:03.416805: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

Traceback (most recent call last):
Traceback (most recent call last):Traceback (most recent call last):
2018-09-12 15:19:03.416944: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'PY3'
File "/usr/lib/python2.7/threading.py", line 754, in run
Traceback (most recent call last):
Exception in thread Thread-39 (most likely raised during interpreter shutdown): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner2018-09-12 15:19:03.417171: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run

File "/usr/lib/python2.7/threading.py", line 754, in run
2018-09-12 15:19:03.417330: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/weakref.py", line 330, in getitem File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_innerException in thread Thread-15 (most likely raised during interpreter shutdown):
Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner2018-09-12 15:19:03.417508: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

Exception in thread Thread-2 (most likely raised during interpreter shutdown): File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 754, in run2018-09-12 15:19:03.417695: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/weakref.py", line 330, in __getitem__Exception in thread Thread-17 (most likely raised during interpreter shutdown):Exception in thread Thread-14 (most likely raised during interpreter shutdown):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
Exception in thread Thread-26 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
Traceback (most recent call last):

Traceback (most recent call last):
Traceback (most recent call last):

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/weakref.py", line 330, in getitem
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run File "/usr/lib/python2.7/threading.py", line 754, in run

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

Exception in thread Thread-35 (most likely raised during interpreter shutdown):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/weakref.py", line 330, in getitem

File "/usr/lib/python2.7/weakref.py", line 330, in getitem

<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/coordinator.py", line 495, in run

<type 'exceptions.TypeError'>: 'NoneType' object is not callable File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/lib/python2.7/contextlib.py", line 50, in exit File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/threading.py", line 754, in run<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/threading.py", line 754, in runTraceback (most recent call last):
2018-09-12 15:19:03.419052: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/weakref.py", line 330, in getitem
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Exception in thread Thread-10 (most likely raised during interpreter shutdown):
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'exc_info'<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner2018-09-12 15:19:03.419395: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

File "/usr/lib/python2.7/weakref.py", line 330, in getitem File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run

File "/usr/lib/python2.7/weakref.py", line 330, in getitem
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/weakref.py", line 330, in getitem

<type 'exceptions.TypeError'>: 'NoneType' object is not callableException in thread Thread-38 (most likely raised during interpreter shutdown):Traceback (most recent call last):
2018-09-12 15:19:03.419725: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

File "/usr/lib/python2.7/threading.py", line 754, in run

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run2018-09-12 15:19:03.419871: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
2018-09-12 15:19:03.420069: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/weakref.py", line 330, in __getitem__Exception in thread Thread-29 (most likely raised during interpreter shutdown):
Traceback (most recent call last):Exception in thread Thread-13 (most likely raised during interpreter shutdown):
File "/usr/lib/python2.7/threading.py", line 754, in run

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_innerException in thread Thread-34 (most likely raised during interpreter shutdown):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/threading.py", line 754, in run2018-09-12 15:19:03.420351: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'
File "/usr/lib/python2.7/weakref.py", line 330, in getitem<type 'exceptions.TypeError'>: 'NoneType' object is not callable

File "/usr/lib/python2.7/threading.py", line 754, in run File "/usr/lib/python2.7/weakref.py", line 330, in getitem
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Traceback (most recent call last):2018-09-12 15:19:03.420482: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

Traceback (most recent call last):2018-09-12 15:19:03.420560: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.AttributeError: 'NoneType' object has no attribute 'Reference'

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 264, in _run
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

Unable to reproduce the result

I have downloaded the code in this repo and downloaded the pretrained model from https://ctolib.com/shaohua0116-demo2program.html, the program, however, is unable to evaluate(or train).
The error information is

nvalidArgumentError (see above for traceback): indices[15,0] = 51 is not in [0, 51)
         [[Node: Program_Decoder/embedding_lookup = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@Program_Decoder/Token_Embedding/embedding_map"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](Program_Decoder/Token_Embedding/embedding_map/read, Program_Decoder/concat, Program_Decoder/embedding_lookup/axis)]]

The reason is that in the LSTM_Decoder function, the definition of s_token iis conflicted with the definition of embedding_lookup: s_token's == token_dim + 1 exceeds the size of embedding_map.
I have tried to redefine s_tokens as token_dim or to enlarge the size of embedding_map, both are runable, but unable to reproduce the results in the paper.

Induction Baseline - Namespace errors

Hi,

I am trying to train the Induction baseline using the Karel Dataset and I got an error for the following lines -

self.pixel_input = self.config.pixel_input or self.config.dataset_type == 'vizdoom'
self.attn_type = self.config.attn_type # I have used 'luong_monotonic'
self.state_encoder_fc = self.config.state_encoder_fc
self.concat_state_feature_direct_prediction =
self.config.concat_state_feature_direct_prediction
self.stack_subsequent_state = self.config.stack_subsequent_state

I have used 'luong_monotonic' for attn_type and set the rest to 0 (boolean).
Are these the intended assignments to the above variables?

about generate_dataset.sh

Hi, I use the generate_dataset.sh to generate karel and vizdoom datasets, but I want to know why the datasets generated are different from the datasets you provided. Please tell me the reason, thank you.

Unable to reproduce the results on Vizdoom

Hi, I found it hard to reproduce the results on the Vizdoom dataset. I use the default arguments except num_k=25, but the results are far from the one mentioned in your paper(seq accu=53% in the paper, while our result is about 40%). So could you provide us with the hyperparameters you use to train a full model on Vizdoom?

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.