Git Product home page Git Product logo

Comments (7)

cdg720 avatar cdg720 commented on August 11, 2024

I looked into "NameError: global name 'array' is not defined".
First, 'array' is not imported in _array.py. Second, 'array' doesn't have GpuArray but 'gpuarray' does.

I ran the followings in pygpu directory:

import array
array.GpuArray
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'GpuArray'

import gpuarray
gpuarray.GpuArray
<type 'pygpu.gpuarray.GpuArray'>

Is 'array' supposed to be 'gpuarray'?

from libgpuarray.

abergeron avatar abergeron commented on August 11, 2024

There was an 'array.py' file that was renamed to '_array.py' because of name conflicts. Maybe there is a leftover array.pyc file, which you should delete.

As for the GpuArrayException, from the sample you posted, it seems there are problems with your blas library. The error just indicates that the blas library returned an error.

from libgpuarray.

cdg720 avatar cdg720 commented on August 11, 2024

Thank you for your answers.

I looked for array.pyc by executing "find / -name array.pyc" and got nothing. "ls" in pygpu returns init.py blas.py dtypes.py gpuarray.h gpuarray_api.h parser.py scan.py tools.pyc
init.pyc blas.pyc dtypes.pyc gpuarray.py numpy_compat.h parser.pyc scan.pyc
_array.py blas.so elemwise.py gpuarray.pyc operations.py reduction.py tests
_array.pyc blas_api.h elemwise.pyc gpuarray.so operations.pyc reduction.pyc tools.py.

When you say "blas library" do you mean clblas? This machine is a mac and I didn't install BLAS as the installation page says OSX comes with the Accelerated framework.

from libgpuarray.

abergeron avatar abergeron commented on August 11, 2024

Yes I mean clBLAS. It seems there is a problem with your intallation (which might just be that it is trying to run on the CPU and clBLAS doesn't like that).

Also, you have an old install of pygpu which does have the array.py file as evidenced by:

File "/Library/Python/2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-intel.egg/pygpu/array.py", line 134, in __divmod_

Get rid of that install and the problem should go away.

from libgpuarray.

cdg720 avatar cdg720 commented on August 11, 2024

Thanks for your help. I really appreciate it. I will look into my clBLAS installation.

I don't have array.py in the pygpu directory. underscore character (_) right before array.py was italicizing it. The following is the error message with escaping:
ERROR: pygpu.tests.test_elemwise.test_divmod('uint64', (50,), array(2.450000047683716, dtype=float32))

Traceback (most recent call last):
File "/Users/dokookchoe/Library/Python/2.7/lib/python/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Library/Python/2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-intel.egg/pygpu/tests/support.py", line 39, in f
func(*args, **kwargs)
File "/Library/Python/2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-intel.egg/pygpu/tests/test_elemwise.py", line 254, in divmod_mixed
out_g = divmod(g, elem)
File "/Library/Python/2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-intel.egg/pygpu/_array.py", line 134, in divmod
if not isinstance(other, array.GpuArray):
NameError: global name 'array' is not defined

from libgpuarray.

abergeron avatar abergeron commented on August 11, 2024

I get a Floating Point Exception: 8 at some point when running the test suite on my machine. However this is after the tests for elemwise operations which seem to be the source of your array problems.

I don't have much time to investigate this right now, but I should have some next week.

from libgpuarray.

abergeron avatar abergeron commented on August 11, 2024

I just realized that the following code line:

File "/Library/Python/2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-intel.egg/pygpu/_array.py", line 134, in __divmod__
if not isinstance(other, array.GpuArray):

should read:

if not isinstance(other, gpuarray.GpuArray):

It never had any version that read array.Gpuarray, so something modified that code and this is what broke it. I'm assuming that this is the cause of this problem and therefore closing the ticket.

from libgpuarray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.