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

timedistributed(dropout) error when batch_size is specified and using theano #4182

Closed
eyaler opened this issue Oct 25, 2016 · 2 comments
Closed

Comments

@eyaler
Copy link

eyaler commented Oct 25, 2016

i want to apply timedistributed to dropout - the reason is i want each timestep to have exactly x% of the features dropped.

i am also using batch_shape for my input with a given batch size since this is required for stateful rnn in my full code. when batch size is given the timedistributed wrapper uses rnn. my backend is theano

this gist recreates the issue
https://gist.github.com/eyaler/6801eee9b2134bcd518ffd34004c1475

may be related to:
#3834

see first comment for error message

@eyaler
Copy link
Author

eyaler commented Oct 25, 2016

Using Theano backend.
Using gpu device 0: GeForce GTX 860M (CNMeM is enabled with initial size: 80.0% of memory, cuDNN 5105)
Traceback (most recent call last):
File "C:/Users/eyalg/Dropbox/python/writer/temp1.py", line 20, in
Y = model.predict_on_batch(X)
File "C:\Anaconda34\lib\site-packages\keras\engine\training.py", line 1286, in predict_on_batch
self._make_predict_function()
File "C:\Anaconda34\lib\site-packages\keras\engine\training.py", line 747, in _make_predict_function
*_kwargs)
File "C:\Anaconda34\lib\site-packages\keras\backend\theano_backend.py", line 787, in function
return Function(inputs, outputs, updates=updates, *_kwargs)
File "C:\Anaconda34\lib\site-packages\keras\backend\theano_backend.py", line 773, in init
**kwargs)
File "C:\Anaconda34\lib\site-packages\theano\compile\function.py", line 326, in function
output_keys=output_keys)
File "C:\Anaconda34\lib\site-packages\theano\compile\pfunc.py", line 486, in pfunc
output_keys=output_keys)
File "C:\Anaconda34\lib\site-packages\theano\compile\function_module.py", line 1776, in orig_function
output_keys=output_keys).create(
File "C:\Anaconda34\lib\site-packages\theano\compile\function_module.py", line 1430, in init
accept_inplace)
File "C:\Anaconda34\lib\site-packages\theano\compile\function_module.py", line 176, in std_fgraph
update_mapping=update_mapping)
File "C:\Anaconda34\lib\site-packages\theano\gof\fg.py", line 180, in init
self.import_r(output, reason="init")
File "C:\Anaconda34\lib\site-packages\theano\gof\fg.py", line 351, in import_r
self.import(variable.owner, reason=reason)
File "C:\Anaconda34\lib\site-packages\theano\gof\fg.py", line 396, in import
variable=r)
theano.gof.fg.MissingInputError: An input of the graph, used to compute Shape(<TensorType(float32, matrix)>), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.

Backtrace when the variable is created:
File "C:/Users/eyalg/Dropbox/python/writer/temp1.py", line 12, in
a = TimeDistributed(Dropout(dropout))(a) # gives error
File "C:\Anaconda34\lib\site-packages\keras\engine\topology.py", line 514, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "C:\Anaconda34\lib\site-packages\keras\engine\topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "C:\Anaconda34\lib\site-packages\keras\engine\topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "C:\Anaconda34\lib\site-packages\keras\layers\wrappers.py", line 131, in call
initial_states=[], input_length=input_length, unroll=unroll)
File "C:\Anaconda34\lib\site-packages\keras\backend\theano_backend.py", line 947, in rnn
go_backwards=go_backwards)

Process finished with exit code 1

@eyaler eyaler closed this as completed Oct 25, 2016
@eyaler
Copy link
Author

eyaler commented Oct 25, 2016

duplicate of:
#4178 (!)

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

1 participant