Use Coverage Trick!
01/01/2018 21:46:12 [INFO] covc_encdec: adjust decoder ok.
args=()
kwargs={'clipnorm': 0.1}
{'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-08, 'self': <emolga.basic.optimizers.Adam object at 0x7f08ad9b0150>, 'args': (), 'rng': <theano.sandbox.rng_mrg.MRG_RandomStreams object at 0x7f08cadadb10>, 'lr': 0.0001, 'kwargs': {'clipnorm': 0.1}, 'save': False}
01/01/2018 21:46:12 [INFO] covc_encdec: build ok.
01/01/2018 21:46:14 [INFO] covc_encdec: total number of the parameters of the model: 78835750
Traceback (most recent call last):
File "keyphrase_copynet.py", line 264, in <module>
agent.compile_('all')
File "/home/nishio/find_keyphrases/seq2seq-keyphrase/emolga/models/covc_encdec.py", line 1849, in compile_
self.compile_train()
File "/home/nishio/find_keyphrases/seq2seq-keyphrase/emolga/models/covc_encdec.py", line 1880, in compile_train
logPxz, logPPL = self.decoder.build_decoder(target, cc_matrix, code, c_mask)
File "/home/nishio/find_keyphrases/seq2seq-keyphrase/emolga/models/covc_encdec.py", line 996, in build_decoder
non_sequences=[context, c_mask, context_A]
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan.py", line 1076, in scan
scan_outs = local_op(*scan_inputs)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 615, in __call__
node = self.make_node(*inputs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan_op.py", line 546, in make_node
inner_sitsot_out.type.dtype))
ValueError: When compiling the inner function of scan the following error has been encountered: The initial state (`outputs_info` in scan nomenclature) of variable IncSubtensor{Set;:int64:}.0 (argument number 5) has dtype float32, while the result of the inner function (`fn`) has dtype float64. This can happen if the inner function of scan results in an upcast or downcast.
python keyphrase_copynet.py 177.96s user 9.00s system 93% cpu 3:19.28 total
scan(fn, sequences=None, outputs_info=None, non_sequences=None, n_steps=None, truncate_gradient=-1, go_backwards=False, mode=None, name=None, profile=False, allow_gc=None, strict=False, return_list=False)
This function constructs and applies a Scan op to the provided
Init_h = self.Initializer(context[:, 0, :]) # initialize hidden vector by converting the last state
Init_a = T.zeros((context.shape[0], context.shape[1]), dtype='float32') # (batch_size, src_len)
coverage = T.zeros((context.shape[0], context.shape[1]), dtype='float32') # (batch_size, src_len)
そこを64にしても
:
ValueError: When compiling the inner function of scan the following error has been encountered: The initial state (`outputs_info` in scan nomenclature) of variable IncSubtensor{Set;:int64:}.0 (argument number 5) has dtype float32, while the result of the inner function (`fn`) has dtype float64. This can happen if the inner function of scan results in an upcast or downcast.
>String value: 'float64', 'float32', or 'float16' (with limited support)
>Default: 'float64'
これを指定してみよう
エラーの種類が変わった
:
File "/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py", line 26, in _amax
return umr_maximum(a, axis, None, out, keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity