arrayfire-python
arrayfire-python copied to clipboard
Bugs in graphics functions
This my code: ` X = af.image.load_image(F[0],is_color=True)
win = af.Window(1280, 768, "imshow") win.image(X) `
It is throwing following error:
AttributeError Traceback (most recent call last)
/home/narsi/anaconda3/lib/python3.5/site-packages/arrayfire-3.5.0-py3.5.egg/arrayfire/graphics.py in image(self, img, title) 139 """ 140 _cell = _Cell(self._r, self._c, title, self._cmap) --> 141 safe_call(backend.get().af_draw_image(self._wnd, img.arr, c_pointer(_cell))) 142 143 def scatter(self, X, Y, Z=None, points=None, marker=MARKER.POINT, title=None):
/home/narsi/anaconda3/lib/python3.5/site-packages/arrayfire-3.5.0-py3.5.egg/arrayfire/util.py in safe_call(af_error) 77 err_len = c_dim_t(0) 78 backend.get().af_get_last_error(c_pointer(err_str), c_pointer(err_len)) ---> 79 raise RuntimeError(to_str(err_str)) 80 81 def get_version():
/home/narsi/anaconda3/lib/python3.5/site-packages/arrayfire-3.5.0-py3.5.egg/arrayfire/util.py in to_str(c_str) 70 71 def to_str(c_str): ---> 72 return str(c_str.value.decode('utf-8')) 73 74 def safe_call(af_error):
AttributeError: 'NoneType' object has no attribute 'decode'
Getting same error with fractal example too.
@itsnarsi can you check if you can run the histogram example ? https://github.com/arrayfire/arrayfire-python/blob/devel/examples/graphics/histogram.py
It is throwing following error:
Traceback (most recent call last):
File "histogram.py", line 19, in
@itsnarsi thanks I'll look into it in a few hours.
@itsnarsi Sorry about the delay. I tried both native python3 and python2 (I don't have access to anaconda). The code seems to work.
Can you print the output of af.info()
?
@itsnarsi can you also run the your program by setting the following environment variable:
AF_PRINT_ERRORS=1 python /path/to/example.py
Hey @pavanky Sorry for the long delay.I was on a holiday trip and totally forgot about it.
Out of al.info():
af.info() ArrayFire v3.3.2 (OpenCL, 64-bit Linux, build f65dd97) [0] NVIDIA : GeForce 840M, 2002 MB
AF_PRINT_ERRORS=1 python /path/to/example.py
Traceback (most recent call last):
File "loadimg.py", line 6, in
@itsnarsi You are using arrayfire 3.3.2 libs. can you update to 3.4.2 ?
Can you also test with regular python instead of anaconda?
@pavanky After update my code started working without any problem in regular python and anaconda. But histogram.py is still giving the same error. And plot3.py is giving following error:
[0] NVIDIA : GeForce 840M, 2002 MB
Traceback (most recent call last):
File "plot3.py", line 32, in
@itsnarsi Is the histogram issue resolved or did you close the issue because your original issue is resolved?
@pavanky Cause my original and histogram issue is resolved. But plot3.py is still persistent.
I am reopening the issue with a different name :)
I'll close if everything is resolved.
I've been getting the same error as described above when trying to run the plot3.py example. Below is output.
$ python plot3.py
ArrayFire v3.5.1 (CUDA, 64-bit Linux, build 0a675e8)
Platform: CUDA Toolkit 8, Driver: 384.90
[0] GeForce GTX 770M, 3018 MB, CUDA Compute 3.0
-1- GeForce GTX 770M, 3017 MB, CUDA Compute 3.0
Traceback (most recent call last):
File "plot3.py", line 32, in <module>
win.plot3(Pts)
File "/usr/local/lib/python2.7/dist-packages/arrayfire-3.6.0-py2.7.egg/arrayfire/graphics.py", line 296, in plot3
assert(line.numdims() == 3)
AttributeError: 'NoneType' object has no attribute 'numdims'
I am getting similar error. No idea on how to debug it. Any help?
eli@jc-acer:~/gitee/arrayfire-python/examples/computer_vision$ AF_PRINT_ERRORS=1 python test.py
ArrayFire v3.9.0 (CUDA, 64-bit Linux, build da1ae517)
Platform: CUDA Runtime 11.5, Driver: 510.47.03
[0] NVIDIA GeForce GTX 1060, 6079 MB, CUDA Compute 6.1
run win.image
Segmentation fault (core dumped)
eli@jc-acer:~/gitee/arrayfire-python/examples/computer_vision$ cat test.py
import arrayfire as af
af.info()
X = af.image.load_image("cat.jpg")
win = af.Window(1280,760, "imshow")
print("run win.image")
win.image(X)
eli@jc-acer:~/gitee/arrayfire-python/examples/computer_vision$
problem fixed after installing forge