Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when run on cpu #13

Open
dungdx34 opened this issue May 16, 2017 · 4 comments
Open

error when run on cpu #13

dungdx34 opened this issue May 16, 2017 · 4 comments

Comments

@dungdx34
Copy link

i have changed the source to run on cpu: use conv2d and pool_2d
but when i run training model, i have a error, please help me:

Traceback (most recent call last):
File "train_bi_char2char.py", line 175, in
main(0, args)
File "train_bi_char2char.py", line 84, in main
prepare_data=prepare_data,
File "/home/dungdx/workspace2/abstract_sentence_convolution/char2char/nmt.py", line 390, in train
cost, not_finite, clipped = f_grad_shared(x, x_mask, y, y_mask)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 871, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 859, in call
outputs = self.fn()
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan_op.py", line 951, in rval
r = p(n, [x[0] for x in i], o)
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan_op.py", line 940, in
self, node)
File "theano/scan_module/scan_perform.pyx", line 220, in theano.scan_module.scan_perform.perform (/home/dungdx/.theano/compiledir_Linux-3.13--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/scan_perform/mod.cpp:2442)
ValueError: ('Sequence is shorter then the required number of steps : (n_steps, seq, seq.shape):', 92, array([[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.],
...,
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.]], dtype=float32), (90, 33))
Apply node that caused the error: for{cpu,encoder__layers}(Subtensor{int64}.0, Subtensor{:int64:}.0, Subtensor{:int64:}.0, Subtensor{:int64:}.0, IncSubtensor{Set;:int64:}.0, encoder_U, encoder_Ux)
Toposort index: 805
Inputs types: [TensorType(int64, scalar), TensorType(float32, matrix), TensorType(float32, 3D), TensorType(float32, 3D), TensorType(float32, 3D), TensorType(float32, matrix), TensorType(float32, matrix)]
Inputs shapes: [(), (90, 33), (92, 33, 1024), (92, 33, 512), (93, 33, 512), (512, 1024), (512, 512)]
Inputs strides: [(), (132, 4), (135168, 4096, 4), (67584, 2048, 4), (67584, 2048, 4), (4096, 4), (2048, 4)]
Inputs values: [array(92), 'not shown', 'not shown', 'not shown', 'not shown', 'not shown', 'not shown']
Outputs clients: [[Subtensor{int64::}(for{cpu,encoder__layers}.0, Constant{1}), Elemwise{second,no_inplace}(for{cpu,encoder__layers}.0, DimShuffle{x,x,x}.0)]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "train_bi_char2char.py", line 175, in
main(0, args)
File "train_bi_char2char.py", line 84, in main
prepare_data=prepare_data,
File "/home/dungdx/workspace2/abstract_sentence_convolution/char2char/nmt.py", line 235, in train
build_model(tparams, model_options)
File "/home/dungdx/workspace2/abstract_sentence_convolution/char2char/char_base.py", line 120, in build_model
proj = get_layer('gru')[1](tparams, hw_out, options, prefix='encoder', mask=x_mask)
File "/home/dungdx/workspace2/abstract_sentence_convolution/char2char/mixer.py", line 614, in gru_layer
strict=True)

HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

@jaseleephd
Copy link
Collaborator

Hey, the code does not support CPU at the moment. Please refer to #11

@kyunghyuncho
Copy link
Contributor

@jasonleeinf perhaps we should update the code to use the new GPU backend which supports CPU-only convolutional and pooling

https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

@jaseleephd
Copy link
Collaborator

@kyunghyuncho Ah cool, didn't know about this. will do this soon!

@dungdx34
Copy link
Author

thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants