CSAILVision / gandissect

Pytorch-based tools for visualizing and understanding the neurons of a GAN. https://gandissect.csail.mit.edu/
MIT License
1.77k stars 282 forks source link

Undefined name: import numbers #3

Closed cclauss closed 5 years ago

cclauss commented 5 years ago

numbers.Number is used these three files but numbers is never imported. This means that it is an undefined name that has the potential to halt the script by raising NameError at runtime.

flake8 testing of https://github.com/CSAILVision/gandissect on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./netdissect/modelconfig.py:52:42: F821 undefined name 'numbers'
                if isinstance(data[key], numbers.Number):
                                         ^
./netdissect/tool/allunitsample.py:47:42: F821 undefined name 'numbers'
                if isinstance(data[key], numbers.Number):
                                         ^
./netdissect/tool/makesample.py:50:42: F821 undefined name 'numbers'
                if isinstance(data[key], numbers.Number):
                                         ^
3    F821 undefined name 'numbers'
3