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

python DBN.py sample #4

Open
MartinThoma opened this issue Jan 11, 2016 · 1 comment
Open

python DBN.py sample #4

MartinThoma opened this issue Jan 11, 2016 · 1 comment

Comments

@MartinThoma
Copy link
Contributor

When I execute python DBN.py sample I get

$ python DBN.py sample
Using gpu device 0: GeForce GTX TITAN Black
Traceback (most recent call last):
  File "DBN.py", line 660, in <module>
    dbn.sample(threshold=0.5)
  File "DBN.py", line 546, in sample
    output = self.generate(top_level)
  File "DBN.py", line 365, in generate
    self.reverse_layers[-1].input: top_level
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/function.py", line 266, in function
    profile=profile)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 489, in pfunc
    no_default_updates=no_default_updates)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 241, in rebuild_collect_shared
    cloned_v = clone_v_get_shared_updates(outputs, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 131, in clone_a
    clone_v_get_shared_updates(i, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates
    clone_a(v.owner, copy_inputs_over)
  File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 135, in clone_a
    strict=rebuild_strict)
  File "/usr/local/lib/python2.7/dist-packages/theano/gof/graph.py", line 211, in clone_with_new_inputs
    new_inputs[i] = curr.type.filter_variable(new)
  File "/usr/local/lib/python2.7/dist-packages/theano/tensor/type.py", line 218, in filter_variable
    self=self)
TypeError: Cannot convert Type TensorType(float64, matrix) (of Variable <TensorType(float64, matrix)>) into Type TensorType(float32, matrix). You can try to manually convert <TensorType(float64, matrix)> into a TensorType(float32, matrix).
@fephsun
Copy link
Owner

fephsun commented Jan 11, 2016

Oh yes, this. In DBN.py, you need to edit the line
NUMPY_DTYPE = numpy.float64
to be float32 instead.

I think there's a better way to fix this problem, by putting the number of bits you want in your .theanorc, and reading from it.

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

2 participants