Coder Social home page Coder Social logo

NNTool Execution: "ModuleNotFoundError: No module named 'stats'" leading into "nntool.quantization.range_provider.RangesMissingError: no ranges found for DEPTHWISE_CONV_2D_0_128" about gap_sdk HOT 3 OPEN

boomer319 avatar boomer319 commented on June 6, 2024
NNTool Execution: "ModuleNotFoundError: No module named 'stats'" leading into "nntool.quantization.range_provider.RangesMissingError: no ranges found for DEPTHWISE_CONV_2D_0_128"

from gap_sdk.

Comments (3)

boomer319 avatar boomer319 commented on June 6, 2024

I did this:
export PYTHONPATH=$PYTHONPATH:~/repo/gap_sdk/tools/nntool/nntool

It found stats but raised errors:

Traceback (most recent call last):
  File "/home/user/repo/gap_sdk/tools/nntool/scripts/nntool", line 107, in <module>
    main()
  File "/home/user/repo/gap_sdk/tools/nntool/scripts/nntool", line 89, in main
    mod.generate_code(args)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/interpreter/generator.py", line 72, in generate_code
    nntool_shell.load_state_file(args.graph_file)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 383, in load_state_file
    self.replay_history()
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 365, in replay_history
    if self.onecmd_plus_hooks(command, add_to_history=False):
  File "/home/aurelio/environments/GAP/lib/python3.10/site-packages/cmd2/cmd2.py", line 1695, in onecmd_plus_hooks
    self.pexcept(ex)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 357, in pexcept
    raise msg
  File "/home/aurelio/environments/GAP/lib/python3.10/site-packages/cmd2/cmd2.py", line 1661, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/aurelio/environments/GAP/lib/python3.10/site-packages/cmd2/cmd2.py", line 2081, in onecmd
    stop = func(statement)
  File "/home/aurelio/environments/GAP/lib/python3.10/site-packages/cmd2/decorators.py", line 223, in cmd_wrapper
    return func(cmd2_app, args)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/interpreter/commands/fquant.py", line 113, in do_fquant
    quantizer.quantize()
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 975, in quantize
    self.bfs_pass()
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 651, in bfs_pass
    self._bfs_pass(self._graph, node, self._qset, visited)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 587, in _bfs_pass
    self._bfs_pass(cur_G, edge.to_node, qset,
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 553, in _bfs_pass
    qrec = self._resolve_qrec(
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 613, in _resolve_qrec
    qrec = self._call_quantizer(cur_G,
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/quantizer/new_quantizer.py", line 448, in _call_quantizer
    return handler.quantize(node, in_qs, stats, **kwargs)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/unified_quantization_handler.py", line 123, in quantize
    return cls._quantize(params, in_qs, stats, **kwargs)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/multiplicative/quantizers/filter_mult.py", line 300, in _quantize
    return cls._quantize_sw(params, in_qs, stats, np.int8, **kwargs)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/multiplicative/quantizers/filter_mult.py", line 225, in _quantize_sw
    min_val, max_val = stats.get_range_out(0, bits=out_bits)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/range_provider.py", line 50, in get_range_out
    return self._provider.get_range(self._nid, 'out', idx, bits=bits, dtype=dtype,
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/range_provider.py", line 195, in get_range
    return self.get_range_out(nid, idx, bits=bits, dtype=dtype)
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/range_provider.py", line 170, in get_range_out
    stat = self.get_stat(nid)['range_out'][idx]
  File "/home/user/repo/gap_sdk/tools/nntool/nntool/quantization/range_provider.py", line 135, in get_stat
    raise RangesMissingError(f'no ranges found for {nid}')
nntool.quantization.range_provider.RangesMissingError: no ranges found for DEPTHWISE_CONV_2D_0_128

from gap_sdk.

sousoux avatar sousoux commented on June 6, 2024

Did you source the sdk?

from gap_sdk.

boomer319 avatar boomer319 commented on June 6, 2024

@sousoux @gemenerik

Yes. Through sourcream.sh and later through sourcing the ai_deck.sh config directly. Both lead to this error.

Info: I am trying to recreate the NanoFlowNet implementation for obstacle avoidance on the ai deck. I opened an issue in that git aswell, in case this error emerges from non gap_sdk related factors.

from gap_sdk.

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.