By the way, is there a not typed list in Theano? I want to append tensors
with different dimensions to a list and return.
On Friday, May 12, 2017 at 10:08:00 AM UTC-8, Xu Zhang wrote:
>
> I used theano.typed_list.append to add a theano variable to a typedlist.
> It gives me this error: Assertion_Error: (TensorType(int8, 4D),
> TensorType(bool, 4D))
> I know output_spikes are boolean type. But I don't know how to initialized
> total_spikes as the same type.
>
> Related code is below:
>
> output_spikes = new_mem > self.threshold
>
> total_spikes=theano.typed_list.append(total_spikes,output_spikes)
>
> Error message:
>
> Compiling...
> Traceback (most recent call last):
>
> File "<ipython-input-7-5c6e5874d546>", line 1, in <module>
> runfile('/space/xzhang/MyLasagneCode_CIFAR10/test_convnet_new.py',
> wdir='/space/xzhang/MyLasagneCode_CIFAR10')
>
> File
> "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py",
> line 866, in runfile
> execfile(filename, namespace)
>
> File
> "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py",
> line 94, in execfile
> builtins.execfile(filename, *where)
>
> File "/space/xzhang/MyLasagneCode_CIFAR10/test_convnet_new.py", line
> 130, in <module>
> main(**kargs)
>
> File "/space/xzhang/MyLasagneCode_CIFAR10/test_convnet_new.py", line 89,
> in main
> new_mem, output_time, updates, Ntransmittedspikes, total_spikes=
> final_dense.get_output()
>
> File "theano_layers.py", line 321, in get_output
> inp, time, updates,incomingspike, total_spikes=
> self.incoming.get_output()
>
> File "theano_layers.py", line 95, in get_output
> inp, time, updates,incomingspike,total_spikes=
> self.incoming.get_output()
>
> File "theano_layers.py", line 62, in get_output
> inp, time, updates, flattenspike, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 253, in get_output
> inp, time, updates, incomingspikes, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 152, in get_output
> inp, time, updates,incomingspike, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 253, in get_output
> inp, time, updates, incomingspikes, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 152, in get_output
> inp, time, updates,incomingspike, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 253, in get_output
> inp, time, updates, incomingspikes, total_spikes =
> self.incoming.get_output()
>
> File "theano_layers.py", line 206, in get_output
> total_spikes=theano.typed_list.append(total_spikes,output_spikes)
>
> 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/typed_list/basic.py", line
> 145, in make_node
> assert x.ttype == toAppend.type, (x.ttype, toAppend.type)
>
> AssertionError: (TensorType(int8, 4D), TensorType(bool, 4D))
>
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.