Vispy Code (6.6) Error
j9ac9k opened this issue · comments
Ogi Moore commented
In the 6th python cell:
program['a_position'] = np.c_[
np.linspace(-1.0, +1.0, 1000),
np.random.uniform(-0.5, +0.5, 1000)]
results in:
TypeError: data must be 32-bit not float64
I may mess with this later, but I know next to nothing about vispy so I'm not sure how well I can troubleshoot the issue.
Cyrille Rossant commented
try to append .astype(np.float32)
at the end of the array
float64 doesn't work well on GPUs so VisPy requires explicit cast to float32
Ogi Moore commented
That was going to be my first try, perhaps I should have done that first instead of opening an issue... still learning thing 'git' thing and associated etiquette. Thanks for the fast response!
Cyrille Rossant commented
closed by #23
giumas commented
It looks like this fix did not propagate to http://ipython-books.github.io/featured-06/
Eddy Hartley commented
Specifically
program['a_position'] = np.c_[
np.linspace(-1.0, +1.0, 1000),
np.random.uniform(-0.5, +0.5, 1000)].astype(np.float32)
Cyrille Rossant commented
Should be fixed now