apriltags
apriltags copied to clipboard
'Detector' object has no attribute 'tag_detector_ptr' or ValueError: the environment variable is longer than 32767 characters
Error
Traceback (most recent call last):
File "apriltags.py", line 75, in <module>
debug=0)
File "C:\Users\main\AppData\Local\Programs\Python\Python37\lib\site-packages\pupil_apriltags\bindings.py", line 273, in __init__
os.environ["PATH"] = dll_path + os.pathsep + os.environ["PATH"]
File "C:\Users\main\AppData\Local\Programs\Python\Python37\lib\os.py", line 687, in __setitem__
self.putenv(key, value)
ValueError: the environment variable is longer than 32767 characters
Exception ignored in: <function Detector.__del__ at 0x000001CE22927798>
Traceback (most recent call last):
File "C:\Users\main\AppData\Local\Programs\Python\Python37\lib\site-packages\pupil_apriltags\bindings.py", line 368, in __del__
if self.tag_detector_ptr is not None:
AttributeError: 'Detector' object has no attribute 'tag_detector_ptr'
FIX
in python\Lib\site-packages\pupil_apriltags\bindings.py Replace
if platform.system() == "Windows":
# the apriltags dll depends on pthreads-win, we inject our pre-built libs
# into the path before loading with ctypes
import pupil_pthreads_win
dll_path = str(pupil_pthreads_win.dll_path.parent.resolve())
os.environ["PATH"] = dll_path + os.pathsep + os.environ["PATH"]
to
if platform.system() == "Windows":
# the apriltags dll depends on pthreads-win, we inject our pre-built libs
# into the path before loading with ctypes
import pupil_pthreads_win
dll_path = str(pupil_pthreads_win.dll_path.parent.resolve())
os.environ["PATH"] = dll_path + os.pathsep
Have the same Problem, but mentioned lines are now
if platform.system() == "Windows":
# the apriltags dll depends on pthreads-win, we inject our pre-built libs
# into the path before loading with ctypes
import pupil_pthreads_win
dll_path = str(pupil_pthreads_win.dll_path.parent.resolve())
os.add_dll_directory(dll_path)
Interesting part:
I call a function creating a Detector in a loop. After several iterations, where the detector works, i get
Exception ignored in: <function Detector.__del__ at 0x000001D69309A820> Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\Tags220907\lib\site-packages\pupil_apriltags\bindings.py", line 371, in __del__ if self.tag_detector_ptr is not None: AttributeError: 'Detector' object has no attribute 'tag_detector_ptr'
If i increase the quad_decimate, i get more iteration, but I still get the above mentioned error. Any Suggestions?