sordonia / hred-qs

Hierarchical Recurrent Encoder Decoder for Query Suggestion
BSD 3-Clause "New" or "Revised" License
108 stars 44 forks source link

an error #5

Closed moluxiaobei closed 6 years ago

moluxiaobei commented 7 years ago

hi: When I run your project,( python train.py --prototype prototype_test)I encountered the following error,how should I change, thank you!

Traceback (most recent call last): File "train.py", line 204, in main(args) File "train.py", line 93, in main model = SessionEncoderDecoder(state) File "/home/dixin/work/hred-qs/session_encdec.py", line 586, in init self.encoder.build_encoder(training_x, xmask=training_hs_mask) File "/home/dixin/work/hred-qs/session_encdec.py", line 167, in build_encoder f_enc, sequences=[xe, xmask], outputs_info=o_enc_info) File "/home/work/anaconda/lib/python2.7/site-packages/theano/scan_module/scan.py", line 1041, in scan scan_outs = local_op(scan_inputs) File "/home/work/anaconda/lib/python2.7/site-packages/theano/gof/op.py", line 611, in call node = self.make_node(inputs, **kwargs) File "/home/work/anaconda/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 538, 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 2) 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.

moluxiaobei commented 7 years ago

Add the following to the file ~/.theanorc: [global] FloatX = float32 solved the problem Successfully.