-
Notifications
You must be signed in to change notification settings - Fork 1.5k
mypy error in efficientnet BlockArgs #2125
Description
Describe the bug
Running ./runtests.sh --mypy can sometimes lead to the following error on local machines:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/opt/virtualenvs/dvenv/lib/python3.8/site-packages/mypy/main.py", line 23, in
console_entry()
File "/opt/virtualenvs/dvenv/lib/python3.8/site-packages/mypy/main.py", line 11, in console_entry
main(None, sys.stdout, sys.stderr)
File "mypy/main.py", line 90, in main
File "mypy/build.py", line 179, in build
File "mypy/build.py", line 253, in _build
File "mypy/build.py", line 2638, in dispatch
File "mypy/build.py", line 2955, in process_graph
File "mypy/build.py", line 3033, in process_fresh_modules
File "mypy/build.py", line 1977, in fix_cross_refs
File "mypy/fixup.py", line 26, in fixup_module
File "mypy/fixup.py", line 77, in visit_symbol_table
File "mypy/fixup.py", line 301, in lookup_qualified_stnode
File "mypy/lookup.py", line 47, in lookup_fully_qualified
AssertionError: Cannot find component 'BlockArgs@791' for 'monai.networks.nets.efficientnet.BlockArgs@791'
This was reported in this pull request: #2066 (comment) by @lyndonboone
Opening this to record the issue and fix in a pull request.
To Reproduce
Steps to reproduce the behavior:
- Clone MONAI repo: git clone https://github.com/Project-MONAI/MONAI
- Install 'python setup.py develop'
- Run commands ./runtests.sh --mypy'
I was able to see the error message on Ubuntu 20.04.
Expected behavior
No error message when running mypy