Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.93k stars 1.09k forks source link

mypy gives legendre error #2140

Closed rijobro closed 3 years ago

rijobro commented 3 years ago

Describe the bug

Output from runtests.sh is:

mypy
mypy 0.812
monai/transforms/intensity/array.py:447:21: error: Module has no attribute "legendre"; maybe "Legendre"?  [attr-defined]
monai/transforms/intensity/array.py:458:21: error: Module has no attribute "legendre"; maybe "Legendre"?  [attr-defined]

Environment

Debug info:

================================
Printing MONAI config...
================================
MONAI version: 0.5.2+21.g234d9c3
Numpy version: 1.20.2
Pytorch version: 1.9.0a0+2ecb2c7
MONAI flags: HAS_EXT = False, USE_COMPILED = False
MONAI rev id: 234d9c3b9f6d1aa09358db9d4c894a0a5f5656a1

Optional dependencies:
Pytorch Ignite version: 0.4.4
Nibabel version: 3.2.1
scikit-image version: 0.18.1
Pillow version: 8.2.0
Tensorboard version: 2.5.0
gdown version: 3.12.2
TorchVision version: 0.9.1+cu102
ITK version: 5.1.2
tqdm version: 4.60.0
lmdb version: 1.2.1
psutil version: 5.8.0

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies

================================
Printing system config...
================================
System: Linux
Linux version: Ubuntu 20.04.2 LTS
Platform: Linux-4.15.0-117-generic-x86_64-with-glibc2.10
Processor: x86_64
Machine: x86_64
Python version: 3.8.8
Process name: ipython
Command: ['/opt/conda/bin/python', '/opt/conda/bin/ipython']
Open files: [popenfile(path='/home/rbrown/.ipython/profile_default/history.sqlite', fd=5, position=32768, mode='r+', flags=688130), popenfile(path='/home/rbrown/.ipython/profile_default/history.sqlite', fd=6, position=147456, mode='r+', flags=688130)]
Num physical CPUs: 48
Num logical CPUs: 96
Num usable CPUs: 96
CPU usage (%): [53.3, 48.2, 41.3, 55.0, 62.8, 62.2, 48.8, 58.1, 57.0, 38.6, 45.9, 53.5, 46.9, 50.9, 57.5, 48.5, 43.5, 69.7, 47.8, 54.6, 61.7, 40.3, 49.4, 51.6, 66.2, 56.4, 52.7, 47.1, 55.9, 47.5, 48.4, 46.1, 51.3, 52.3, 51.3, 54.5, 53.1, 56.9, 53.8, 52.9, 61.0, 54.4, 54.8, 55.6, 45.7, 44.0, 54.4, 53.9, 58.6, 43.9, 57.1, 43.9, 50.0, 42.5, 45.8, 44.7, 48.9, 60.7, 43.7, 49.3, 39.4, 42.2, 41.2, 51.2, 39.6, 43.4, 44.3, 48.1, 41.8, 52.6, 54.1, 50.4, 45.9, 45.8, 52.6, 63.0, 43.6, 47.1, 55.7, 57.8, 45.6, 45.0, 54.4, 54.0, 60.2, 54.7, 50.5, 51.6, 45.5, 45.6, 47.0, 48.4, 46.9, 68.7, 51.5, 50.2]
CPU freq. (MHz): 3339
Load avg. in last 1, 5, 15 mins (%): [67.7, 86.9, 84.7]
Disk usage (%): 51.1
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 1510.6
Available memory (GB): 1162.0
Used memory (GB): 247.2

================================
Printing GPU config...
================================
Num GPUs: 1
Has CUDA: True
CUDA version: 11.3
cuDNN enabled: True
cuDNN version: 8200
Current device: 0
Library compiled for CUDA architectures: ['sm_52', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'compute_86']
GPU 0 Name: Tesla V100-SXM3-32GB
GPU 0 Is integrated: False
GPU 0 Is multi GPU board: False
GPU 0 Multi processor count: 80
GPU 0 Total memory (GB): 31.7
GPU 0 CUDA capability (maj.min): 7.0
Nic-Ma commented 3 years ago

Hi @rijobro ,

May I know whether this issue still exists?

Thanks.

rijobro commented 3 years ago

Just checked again, and yes, I get it on certain machines (remote linux) but not others (local MacOS). Both running mypy 0.812.

wyli commented 3 years ago

couldn't replicate it with the latest version of mypy numpy