astooke / Synkhronos

Extension to Theano for multi-GPU data parallelism
MIT License
20 stars 5 forks source link

TypeError: All function inputs must be of Synkhronos type Data. #9

Closed dlunga closed 7 years ago

dlunga commented 7 years ago

In testing the intro example (http://synkhronos.readthedocs.io/en/latest/pages/intro_example.html) I seem to running into function input errors. Any pointer are appreciated.

>>> y = theano.shared(np.random.randn(10, 20).astype('float32'))
>>> z = T.mean(x.dot(y), axis=0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
>>> x = T.matrix('x')
>>> z = T.mean(x.dot(y), axis=0)
>>> f_th = theano.function([x], z)
>>> f = synk.function([x], z)
>>> synk.distribute()
Synkhronos distributing functions...
...distribution complete.
>>> x_dat = np.random.randn(100, 10).astype('float32')
>>> r_th = f_th(x_dat)
>>> r = f(x_dat)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.5/site-packages/synkhronos/function_module.py", line 487, in __call__
    self._share_input_data(ordered_inputs, batch, batch_s)
  File "/opt/conda/lib/python3.5/site-packages/synkhronos/function_module.py", line 366, in _share_input_data
    check_synk_inputs(synk_inputs, self._input_vars)
  File "/opt/conda/lib/python3.5/site-packages/synkhronos/function_module.py", line 437, in check_synk_inputs
    raise TypeError("All function inputs must be of Synkhronos type Data.")
TypeError: All function inputs must be of Synkhronos type Data.
astooke commented 7 years ago

Hi, thanks for your question, I will be cleaning up the examples the next opportunity I get, in just a couple of days...sorry for the delay!

astooke commented 7 years ago

Hi, I have just pushed a new set of demos (in the demos/ folder). For now, please reference those for examples of how-to. I recommend both reading and running the code. :)

The documentation is a bit out-of-date, and I hope to fix that very soon.

astooke commented 7 years ago

That part of the documentation has now been updated. :)