Lornatang / SRGAN-PyTorch

A simple and complete implementation of super-resolution paper.
Apache License 2.0
410 stars 105 forks source link

TypeError: unsupported operand type(s) for | #66

Closed AnSMru closed 1 year ago

AnSMru commented 1 year ago

Traceback (most recent call last): File "test.py", line 23, in from image_quality_assessment import PSNR, SSIM File "/SRGAN-PyTorch/image_quality_assessment.py", line 205, in def _get_mscn_feature(image: np.ndarray) -> list[float | Any]: TypeError: unsupported operand type(s) for |: 'type' and '_SpecialForm'

What to do?

huchi00057 commented 1 year ago

I have same question!

huchi00057 commented 1 year ago

You can create a new virtual environment in python 3.10

huchi00057 commented 1 year ago

After recreate the environment (python = 3.10), my problem had been solved!

huchi00057 commented 1 year ago

image

Reference: https://github.com/tiangolo/typer/issues/371

AnSMru commented 1 year ago

I use Jetson TX2, and I can only 3.6 with cuda

Lornatang commented 1 year ago

change np.ndarray to np.ndarray | Any

charleneguillaumot commented 1 year ago

Hello, your last suggestion does not work for me Lornatang

Lornatang commented 1 year ago

@charleneguillaumot Perhaps you can remove the definition of the type~

Lornatang commented 1 year ago

Fixed. Thank you~