shentianxiao / language-style-transfer

Apache License 2.0
553 stars 135 forks source link

set n_layer=3 caused error #16

Open SeekPoint opened 5 years ago

SeekPoint commented 5 years ago

gpuws@gpuws32g:~/ub16_prj/language-style-transfer/code$ python style_transfer.py --train ../data/yelp/sentiment.train --dev ../data/yelp/sentiment.dev --output ../tmp_m3/sentiment.dev --vocab ../tmp_m3/yelp.vocab --model ../tmp_m3/model

{ 'batch_size': 128, 'beam': 3, 'dev': '../data/yelp/sentiment.dev', 'dim_emb': 100, 'dim_y': 200, 'dim_z': 500, 'dropout_keep_prob': 0.5, 'embedding': '', 'filter_sizes': '1,2,3,4,5', 'gamma_decay': 1, 'gamma_init': 0.1, 'gamma_min': 0.1, 'learning_rate': 0.0005, 'load_model': False, 'max_epochs': 20, 'max_seq_length': 20, 'max_train_size': -1, 'model': '../tmp_m3/model', 'n_filters': 128, 'n_layers': 3, 'online_testing': False, 'output': '../tmp_m3/sentiment.dev', 'rho': 1, 'steps_per_checkpoint': 1000, 'test': '', 'train': '../data/yelp/sentiment.train', 'vocab': '../tmp_m3/yelp.vocab'}

sents of training file 0: 176787

sents of training file 1: 267314

vocabulary size: 9357 2018-12-25 17:07:25.818297: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2018-12-25 17:07:25.886704: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2018-12-25 17:07:25.886990: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.6575 pciBusID: 0000:01:00.0 totalMemory: 10.91GiB freeMemory: 8.09GiB 2018-12-25 17:07:25.887005: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) Traceback (most recent call last): File "style_transfer.py", line 228, in model = create_model(sess, args, vocab) File "style_transfer.py", line 192, in create_model model = Model(args, vocab) File "style_transfer.py", line 72, in init initial_state=init_state, scope='encoder') File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 614, in dynamic_rnn dtype=dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 777, in _dynamic_rnn_loop swap_memory=swap_memory) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2816, in while_loop result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2640, in BuildLoop pred, body, original_loop_vars, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2590, in _BuildLoop body_result = body(packed_vars_for_body) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 762, in _time_step (output, new_state) = call_cell() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 748, in call_cell = lambda: cell(input_t, state) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in call return super(RNNCell, self).call(inputs, state) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 575, in call outputs = self.call(inputs, args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1060, in call (len(self.state_size), state)) ValueError: Expected state to be a tuple of length 3, but received: Tensor("encoder_1/while/Identity_2:0", shape=(?, 700), dtype=float32)

If you suspect this is an IPython bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True

gpuws@gpuws32g:~/ub16_prj/language-style-transfer/code$