GFPGAN
GFPGAN copied to clipboard
Numpy is not available
win 11 python 3.10 numba 0.55.1 numpy 1.21.5
运行 python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
后提示
\Python310\lib\site-packages\torch\_masked\__init__.py:223: UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:68.)
example_input = torch.tensor([[-3, -2, -1], [0, 1, 2]])
Traceback (most recent call last):
File "C:\Users\Steph\App\GFPGAN\inference_gfpgan.py", line 7, in <module>
from basicsr.utils import imwrite
File "C:\Users\Steph\AppData\Local\Programs\Python\Python310\lib\site-packages\basicsr\__init__.py", line 3, in <module>
from .archs import *
File "C:\Users\Steph\AppData\Local\Programs\Python\Python310\lib\site-packages\basicsr\archs\__init__.py", line 5, in <module>
from basicsr.utils import get_root_logger, scandir
File "C:\Users\Steph\AppData\Local\Programs\Python\Python310\lib\site-packages\basicsr\utils\__init__.py", line 1, in <module>
from .diffjpeg import DiffJPEG
File "C:\Users\Steph\AppData\Local\Programs\Python\Python310\lib\site-packages\basicsr\utils\diffjpeg.py", line 19, in <module>
y_table = nn.Parameter(torch.from_numpy(y_table))
RuntimeError: Numpy is not available`
TRY THIS pip install numpy --upgrade
TRY THIS pip install numpy --upgrade
~~Also having the same issue. Console stated that the latest version of numpy was incompatible and needed a version less than 1.21, so I installed 1.20 using pip install numpy==1.20 and I also get basically the same error as above~~.
Tried again and it seems to be working now.
@S1U , @GBCam There is no need to waste time on tossing the environment, try
https://github.com/TencentARC/GFPGAN/issues/194
numpy版本高了 requirement.txt里面有说明啊! numpy<1.21 # numba requires numpy<1.21,>=1.17
pip install requiemenet没啥用 ,pip install numpy --upgrade 好像太大了,我改成 pip install pip install numpy==1.23.5 貌似解决了