cortex_old icon indicating copy to clipboard operation
cortex_old copied to clipboard

error in run neuroimaging demos rbm_ni.py

Open AojunZhou opened this issue 8 years ago • 10 comments

python rbm_ni.py rbm_olin.yaml,error as followed:

Traceback (most recent call last): File "rbm_ni.py", line 213, in train(*_exp_dict) File "rbm_ni.py", line 187, in train [X], cost, tparams, constants, updates, extra_outs, *_learning_args) File "/usr/local/lib/python2.7/dist-packages/cortex-0.12a-py2.7.egg/cortex/utils/training.py", line 289, in set_optimizer extra_outs=extra_outs, *_optimizer_args) File "/usr/local/lib/python2.7/dist-packages/cortex-0.12a-py2.7.egg/cortex/utils/op.py", line 297, in sgd f_grad_shared = theano.function( File "/usr/local/lib/python2.7/dist-packages/Theano-0.9.0dev0-py2.7.egg/theano/tensor/var.py", line 235, in radd return theano.tensor.basic.add(other, self) File "/usr/local/lib/python2.7/dist-packages/Theano-0.9.0dev0-py2.7.egg/theano/gof/op.py", line 613, in call node = self.make_node(_inputs, **kwargs) File "/usr/local/lib/python2.7/dist-packages/Theano-0.9.0dev0-py2.7.egg/theano/tensor/elemwise.py", line 553, in make_node inputs = list(map(as_tensor_variable, inputs)) File "/usr/local/lib/python2.7/dist-packages/Theano-0.9.0dev0-py2.7.egg/theano/tensor/basic.py", line 210, in as_tensor_variable raise AsTensorError("Cannot convert %s to TensorType" % str_x, type(x)) theano.tensor.var.AsTensorError: ('Cannot convert [(rbm_W_grad, Elemwise{add,no_inplace}.0), (rbm_visible_mu_grad, Elemwise{add,no_inplace}.0), (rbm_hidden_z_grad, Elemwise{add,no_inplace}.0)] to TensorType', <type 'list'>)

AojunZhou avatar Jul 05 '16 06:07 AojunZhou

I fixed an unrelated bug when running that script: https://github.com/rdevon/cortex/commit/1f566bc73e4ff9453a88a3268e5b1f7606ceeedc

but I was unable to replicate your error. I noticed that you're using Theano-0.9.0dev0. How did you install Theano?

rdevon avatar Jul 05 '16 14:07 rdevon

Thanks, I have installed Theano, and I can run test RMB_mnist Successfully, I will try it again tomorrow.

�� 2016-07-05 22:54:53��"Devon Hjelm" [email protected] ������

I fixed an unrelated bug when running that script: 1f566bc

but I was unable to replicate your error. I noticed that you're using Theano-0.9.0dev0. How did you install Theano?

�� You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

AojunZhou avatar Jul 05 '16 15:07 AojunZhou

hi,

sorry,i still not solve this problem, when I debug the code,I find the bug in utils/op.py line 297 updates=gsup+extra_ups

Because type(gsup)=<type 'list'>

maybe this issue caused by Theano.

thanks

-----原始邮件----- 发件人: "Devon Hjelm" [email protected] 发送时间: 2016年7月5日 星期二 收件人: rdevon/cortex [email protected] 抄送: Zhouaojun [email protected], Author [email protected] 主题: Re: [rdevon/cortex] error in run neuroimaging demos rbm_ni.py (#9)

I fixed an unrelated bug when running that script: 1f566bc

but I was unable to replicate your error. I noticed that you're using Theano-0.9.0dev0. How did you install Theano?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

AojunZhou avatar Jul 06 '16 08:07 AojunZhou

So you can run rbm_mnist but not rbm_ni? That's strange: the code is almost the same. I cannot reproduce your error, but I have a hunch what's going on. I've pushed a small change: https://github.com/rdevon/cortex/commit/e53b54e73c50cabe072ab91ab368b328abadb338 that casts updates as an OrderedUpdates. Hopefully that fixes it.

rdevon avatar Jul 06 '16 15:07 rdevon

(Pdb) updates = theano.OrderedUpdates(updates) *** TypeError: TensorType does not support iteration. Maybe you are using builtin.sum instead of theano.tensor.sum? (Maybe .max?)

sorry,the new bug occured,and i cannot run rbm_mnis now.

thanks

-----原始邮件----- 发件人: "Devon Hjelm" [email protected] 发送时间: 2016年7月6日 星期三 收件人: rdevon/cortex [email protected] 抄送: Zhouaojun [email protected], Comment [email protected] 主题: Re: [rdevon/cortex] error in run neuroimaging demos rbm_ni.py (#9)

So you can run rbm_mnist but not rbm_ni? That's strange: the code is almost the same. I cannot reproduce your error, but I have a hunch what's going on. I've pushed a small change: e53b54e that casts updates as an . Hopefully that fixes it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

AojunZhou avatar Jul 07 '16 14:07 AojunZhou

Interesting. Can you do 2 things for me, as I cannot reproduce these errors:

  1. provide the full traceback as when you run the script.
  2. provide the value of updates from within Pdb

Thanks

rdevon avatar Jul 07 '16 15:07 rdevon

Also, can you confirm your version of Theano?

rdevon avatar Jul 07 '16 15:07 rdevon

hi,

sorry,I reply is too late

the attachment contains the error

-----原始邮件----- 发件人: "Devon Hjelm" [email protected] 发送时间: 2016年7月7日 星期四 收件人: rdevon/cortex [email protected] 抄送: Zhouaojun [email protected], Comment [email protected] 主题: Re: [rdevon/cortex] error in run neuroimaging demos rbm_ni.py (#9)

Interesting. Can you do 2 things for me, as I cannot reproduce these errors:

  1. provide the full traceback as when you run the script.
  2. provide the value of updates from within Pdb

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

AojunZhou avatar Jul 19 '16 02:07 AojunZhou

my Theano version is Theano-0.9.0dev0-py2.7 @rdevon

AojunZhou avatar Jul 19 '16 02:07 AojunZhou

hi, when i reinstall the cortex,it still not work.

-----原始邮件----- 发件人: "Devon Hjelm" [email protected] 发送时间: 2016年7月7日 星期四 收件人: rdevon/cortex [email protected] 抄送: Zhouaojun [email protected], Comment [email protected] 主题: Re: [rdevon/cortex] error in run neuroimaging demos rbm_ni.py (#9)

Interesting. Can you do 2 things for me, as I cannot reproduce these errors:

  1. provide the full traceback as when you run the script.
  2. provide the value of updates from within Pdb

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

AojunZhou avatar Jul 19 '16 06:07 AojunZhou