0

This is the first line of code in the module:

from rembg import remove

This is the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~\Anaconda3\lib\site-packages\numba\core\errors.py:823, in new_error_context(fmt_, *args, **kwargs)
    822 try:
--> 823     yield
    824 except NumbaError as e:

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:265, in BaseLower.lower_block(self, block)
    263     with new_error_context('lowering "{inst}" at {loc}', inst=inst,
    264                            loc=self.loc, errcls_=defaulterrcls):
--> 265         self.lower_inst(inst)
    266 self.post_block(block)

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:567, in Lower.lower_inst(self, inst)
    566 if isinstance(inst, _class):
--> 567     func(self, inst)
    568     return

File ~\Anaconda3\lib\site-packages\numba\parfors\parfor_lowering.py:348, in _lower_parfor_parallel(lowerer, parfor)
    347     print("loop_ranges = ", loop_ranges)
--> 348 call_parallel_gufunc(
    349     lowerer,
    350     func,
    351     gu_signature,
    352     func_sig,
    353     func_args,
    354     func_arg_types,
    355     loop_ranges,
    356     parfor_redvars,
    357     parfor_reddict,
    358     redarrs,
    359     parfor.init_block,
    360     index_var_typ,
    361     parfor.races,
    362     exp_name_to_tuple_var)
    364 if nredvars > 0:

File ~\Anaconda3\lib\site-packages\numba\parfors\parfor_lowering.py:1589, in call_parallel_gufunc(lowerer, cres, gu_signature, outer_sig, expr_args, expr_arg_types, loop_ranges, redvars, reddict, redarrdict, init_block, index_var_typ, races, exp_name_to_tuple_var)
   1588 # These are necessary for build_gufunc_wrapper to find external symbols
-> 1589 _launch_threads()
   1591 info = build_gufunc_wrapper(llvm_func, cres, sin, sout,
   1592                             cache=False, is_parfors=True)

File ~\Anaconda3\lib\site-packages\numba\np\ufunc\parallel.py:521, in _launch_threads()
    519 launch_threads(NUM_THREADS)
--> 521 _load_threading_functions(lib)  # load late
    523 # set library name so it can be queried

File ~\Anaconda3\lib\site-packages\numba\np\ufunc\parallel.py:545, in _load_threading_functions(lib)
    543 _get_thread_id = CFUNCTYPE(c_int)(lib.get_thread_id)
--> 545 ll.add_symbol('set_parallel_chunksize', lib.set_parallel_chunksize)
    546 ll.add_symbol('get_parallel_chunksize', lib.get_parallel_chunksize)

AttributeError: module 'numba.np.ufunc.tbbpool' has no attribute 'set_parallel_chunksize'

During handling of the above exception, another exception occurred:

LoweringError                             Traceback (most recent call last)
Input In [9], in <cell line: 1>()
----> 1 from rembg import remove

File ~\Anaconda3\lib\site-packages\rembg\__init__.py:5, in <module>
      1 from . import _version
      3 __version__ = _version.get_versions()["version"]
----> 5 from .bg import remove
      6 from .session_factory import new_session

File ~\Anaconda3\lib\site-packages\rembg\bg.py:16, in <module>
     14 from PIL import Image
     15 from PIL.Image import Image as PILImage
---> 16 from pymatting.alpha.estimate_alpha_cf import estimate_alpha_cf
     17 from pymatting.foreground.estimate_foreground_ml import estimate_foreground_ml
     18 from pymatting.util.util import stack_images

File ~\Anaconda3\lib\site-packages\pymatting\__init__.py:2, in <module>
      1 # Import relevant submodules for ease-of-use
----> 2 from pymatting.util import *
      3 from pymatting.laplacian import *
      4 from pymatting.solver import *

File ~\Anaconda3\lib\site-packages\pymatting\util\__init__.py:2, in <module>
      1 from pymatting.util.timer import Timer
----> 2 from pymatting.util.kdtree import KDTree, knn
      3 from pymatting.util.boxfilter import boxfilter
      4 from pymatting.util.util import (
      5     apply_to_channels,
      6     blend,
   (...)
     27     weights_to_laplacian,
     28 )

File ~\Anaconda3\lib\site-packages\pymatting\util\kdtree.py:138, in <module>
    132             split_values[i_node] = split_value
    134     return n_nodes
    137 @njit("void(i8[:], i8[:], i8[:], i8[:], i8[:], f4[:, :, :], f4[:], f4[:, :], f4[:, :], i8[:, :], f4[:, :], i8)", cache=True, nogil=True, parallel=True)
--> 138 def _find_knn(
    139     i0_inds,
    140     i1_inds,
    141     less_inds,
    142     more_inds,
    143     split_dims,
    144     bounds,
    145     split_values,
    146     points,
    147     query_points,
    148     out_indices,
    149     out_distances,
    150     k,
    151 ):
    152     dimension = points.shape[1]
    154     # For each query point

File ~\Anaconda3\lib\site-packages\numba\core\decorators.py:219, in _jit.<locals>.wrapper(func)
    217     with typeinfer.register_dispatcher(disp):
    218         for sig in sigs:
--> 219             disp.compile(sig)
    220         disp.disable_compile()
    221 return disp

File ~\Anaconda3\lib\site-packages\numba\core\dispatcher.py:965, in Dispatcher.compile(self, sig)
    963 with ev.trigger_event("numba:compile", data=ev_details):
    964     try:
--> 965         cres = self._compiler.compile(args, return_type)
    966     except errors.ForceLiteralArg as e:
    967         def folded(args, kws):

File ~\Anaconda3\lib\site-packages\numba\core\dispatcher.py:125, in _FunctionCompiler.compile(self, args, return_type)
    124 def compile(self, args, return_type):
--> 125     status, retval = self._compile_cached(args, return_type)
    126     if status:
    127         return retval

File ~\Anaconda3\lib\site-packages\numba\core\dispatcher.py:139, in _FunctionCompiler._compile_cached(self, args, return_type)
    136     pass
    138 try:
--> 139     retval = self._compile_core(args, return_type)
    140 except errors.TypingError as e:
    141     self._failed_cache[key] = e

File ~\Anaconda3\lib\site-packages\numba\core\dispatcher.py:152, in _FunctionCompiler._compile_core(self, args, return_type)
    149 flags = self._customize_flags(flags)
    151 impl = self._get_implementation(args, {})
--> 152 cres = compiler.compile_extra(self.targetdescr.typing_context,
    153                               self.targetdescr.target_context,
    154                               impl,
    155                               args=args, return_type=return_type,
    156                               flags=flags, locals=self.locals,
    157                               pipeline_class=self.pipeline_class)
    158 # Check typing error if object mode is used
    159 if cres.typing_error is not None and not flags.enable_pyobject:

File ~\Anaconda3\lib\site-packages\numba\core\compiler.py:716, in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class)
    692 """Compiler entry point
    693 
    694 Parameter
   (...)
    712     compiler pipeline
    713 """
    714 pipeline = pipeline_class(typingctx, targetctx, library,
    715                           args, return_type, flags, locals)
--> 716 return pipeline.compile_extra(func)

File ~\Anaconda3\lib\site-packages\numba\core\compiler.py:452, in CompilerBase.compile_extra(self, func)
    450 self.state.lifted = ()
    451 self.state.lifted_from = None
--> 452 return self._compile_bytecode()

File ~\Anaconda3\lib\site-packages\numba\core\compiler.py:520, in CompilerBase._compile_bytecode(self)
    516 """
    517 Populate and run pipeline for bytecode input
    518 """
    519 assert self.state.func_ir is None
--> 520 return self._compile_core()

File ~\Anaconda3\lib\site-packages\numba\core\compiler.py:499, in CompilerBase._compile_core(self)
    497         self.state.status.fail_reason = e
    498         if is_final_pipeline:
--> 499             raise e
    500 else:
    501     raise CompilerError("All available pipelines exhausted")

File ~\Anaconda3\lib\site-packages\numba\core\compiler.py:486, in CompilerBase._compile_core(self)
    484 res = None
    485 try:
--> 486     pm.run(self.state)
    487     if self.state.cr is not None:
    488         break

File ~\Anaconda3\lib\site-packages\numba\core\compiler_machinery.py:368, in PassManager.run(self, state)
    365 msg = "Failed in %s mode pipeline (step: %s)" % \
    366     (self.pipeline_name, pass_desc)
    367 patched_exception = self._patch_error(msg, e)
--> 368 raise patched_exception

File ~\Anaconda3\lib\site-packages\numba\core\compiler_machinery.py:356, in PassManager.run(self, state)
    354 pass_inst = _pass_registry.get(pss).pass_inst
    355 if isinstance(pass_inst, CompilerPass):
--> 356     self._runPass(idx, pass_inst, state)
    357 else:
    358     raise BaseException("Legacy pass in use")

File ~\Anaconda3\lib\site-packages\numba\core\compiler_lock.py:35, in _CompilerLock.__call__.<locals>._acquire_compile_lock(*args, **kwargs)
     32 @functools.wraps(func)
     33 def _acquire_compile_lock(*args, **kwargs):
     34     with self:
---> 35         return func(*args, **kwargs)

File ~\Anaconda3\lib\site-packages\numba\core\compiler_machinery.py:311, in PassManager._runPass(self, index, pss, internal_state)
    309     mutated |= check(pss.run_initialization, internal_state)
    310 with SimpleTimer() as pass_time:
--> 311     mutated |= check(pss.run_pass, internal_state)
    312 with SimpleTimer() as finalize_time:
    313     mutated |= check(pss.run_finalizer, internal_state)

File ~\Anaconda3\lib\site-packages\numba\core\compiler_machinery.py:273, in PassManager._runPass.<locals>.check(func, compiler_state)
    272 def check(func, compiler_state):
--> 273     mangled = func(compiler_state)
    274     if mangled not in (True, False):
    275         msg = ("CompilerPass implementations should return True/False. "
    276                "CompilerPass with name '%s' did not.")

File ~\Anaconda3\lib\site-packages\numba\core\typed_passes.py:394, in NativeLowering.run_pass(self, state)
    391 with targetctx.push_code_library(library):
    392     lower = lowering.Lower(targetctx, library, fndesc, interp,
    393                            metadata=metadata)
--> 394     lower.lower()
    395     if not flags.no_cpython_wrapper:
    396         lower.create_cpython_wrapper(flags.release_gil)

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:168, in BaseLower.lower(self)
    166 if self.generator_info is None:
    167     self.genlower = None
--> 168     self.lower_normal_function(self.fndesc)
    169 else:
    170     self.genlower = self.GeneratorLower(self)

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:222, in BaseLower.lower_normal_function(self, fndesc)
    220 # Init argument values
    221 self.extract_function_arguments()
--> 222 entry_block_tail = self.lower_function_body()
    224 # Close tail of entry block, do not emit debug metadata else the
    225 # unconditional jump gets associated with the metadata from the function
    226 # body end.
    227 with debuginfo.suspend_emission(self.builder):

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:251, in BaseLower.lower_function_body(self)
    249     bb = self.blkmap[offset]
    250     self.builder.position_at_end(bb)
--> 251     self.lower_block(block)
    252 self.post_lower()
    253 return entry_block_tail

File ~\Anaconda3\lib\site-packages\numba\core\lowering.py:265, in BaseLower.lower_block(self, block)
    262     defaulterrcls = partial(LoweringError, loc=self.loc)
    263     with new_error_context('lowering "{inst}" at {loc}', inst=inst,
    264                            loc=self.loc, errcls_=defaulterrcls):
--> 265         self.lower_inst(inst)
    266 self.post_block(block)

File ~\Anaconda3\lib\contextlib.py:137, in _GeneratorContextManager.__exit__(self, typ, value, traceback)
    135     value = typ()
    136 try:
--> 137     self.gen.throw(typ, value, traceback)
    138 except StopIteration as exc:
    139     # Suppress StopIteration *unless* it's the same exception that
    140     # was passed to throw().  This prevents a StopIteration
    141     # raised inside the "with" statement from being suppressed.
    142     return exc is not value

File ~\Anaconda3\lib\site-packages\numba\core\errors.py:837, in new_error_context(fmt_, *args, **kwargs)
    835     else:
    836         tb = None
--> 837     raise newerr.with_traceback(tb)
    838 elif use_new_style_errors():
    839     raise e

LoweringError: Failed in nopython mode pipeline (step: native lowering)
module 'numba.np.ufunc.tbbpool' has no attribute 'set_parallel_chunksize'

File "..\..\..\..\..\Anaconda3\lib\site-packages\pymatting\util\kdtree.py", line 155:
def _find_knn(
    <source elided>
    # For each query point
    for i_query in prange(query_points.shape[0]):
    ^

During: lowering "id=3[LoopNest(index_variable = parfor_index.613, range = (0, $20binary_subscr.8, 1))]{132: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (177)>, 134: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (177)>, 264: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (193)>, 266: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (193)>, 530: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (216)>, 30: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (155)>, 420: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (206)>, 304: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (198)>, 564: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (222)>, 574: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (228)>, 575: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (169)>, 576: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (234)>, 324: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (199)>, 452: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (211)>, 198: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (184)>, 454: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (190)>, 326: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (199)>, 214: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (185)>, 86: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (169)>, 216: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (188)>, 342: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (201)>, 120: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (176)>, 350: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (199)>, 96: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (170)>, 230: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (190)>, 358: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (204)>, 496: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (213)>, 248: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (190)>, 250: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (190)>, 380: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (206)>, 382: <ir.Block at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (206)>}Var(parfor_index.613, kdtree.py:155)" at C:\Users\nicholdw\Anaconda3\lib\site-packages\pymatting\util\kdtree.py (155)
Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
nicomp
  • 4,344
  • 4
  • 27
  • 60
  • 1
    @Tomerikoo's edit removed irrelevant commentary from your title because your question should be free of irrelevant commentary ([ask]). Please don't rollback their edit. – Pranav Hosangadi Feb 16 '23 at 15:44

0 Answers0