nianticlabs / simplerecon

[ECCV 2022] SimpleRecon: 3D Reconstruction Without 3D Convolutions
Other
1.28k stars 120 forks source link

Error running `python test.py` due to kornia version #35

Closed natesimon closed 1 year ago

natesimon commented 1 year ago

I got the following error message running python test.py due to kornia 0.6.10:

RuntimeError: 
Expression of type | cannot be used in a type expression:
  File "/home/natesimon/anaconda3/envs/simplerecon/lib/python3.9/site-packages/kornia/filters/blur_pool.py", line 129
def blur_pool2d(input: Tensor, kernel_size: tuple[int, int] | int, stride: int = 2):
                                            ~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    r"""Compute blurs and downsample a given feature map.
'blur_pool2d' is being compiled since it was called from 'pyrdown'
  File "/home/natesimon/Documents/simplerecon/utils/generic_utils.py", line 92
    output = [input_tensor]
    for _ in range(num_scales - 1):
        down = kornia.filters.blur_pool2d(output[-1], 3)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
        output.append(down)
    return output

This was resolved by downgrading kornia to 0.5.11. pip install kornia==0.5.11

mohammed-amr commented 1 year ago

Thanks for pointing this out! I can confirm the bug. I'm updating the env file.

jgibson2 commented 1 year ago

I believe this may be fixed if you run with python >=3.10 as well.