OpenGVLab / Vision-RWKV

Vision-RWKV: Efficient and Scalable Visual Perception with RWKV-Like Architectures
https://arxiv.org/abs/2403.02308
Apache License 2.0
371 stars 14 forks source link

报错:RuntimeError: Error building extension 'wkv',请问该怎么解决呀? #18

Closed Aqual-lu closed 3 months ago

Aqual-lu commented 6 months ago

以下是控制板报错的所有提示: Using C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu118 as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu118\wkv\build.ninja... Building extension module wkv... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: error: 'D:/����/5.Vision-RWKV Efficient and Scalable Visual/Vision-RWKV-master/classification_internimage/models/models/cuda/wkv_op.cpp', needed by 'wkv_op.o', missing and no known rule to make it Traceback (most recent call last): File "E:\anaconda\Lib\site-packages\torch\utils\cpp_extension.py", line 2100, in _run_ninja_build subprocess.run( File "E:\anaconda\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\文献\5.Vision-RWKV Efficient and Scalable Visual\Vision-RWKV-master\classification_internimage\models\vrwkv.py", line 27, in wkv_cuda = load(name="wkv", sources=["models/cuda/wkv_op.cpp", "models/cuda/wkv_cuda.cu"], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\anaconda\Lib\site-packages\torch\utils\cpp_extension.py", line 1308, in load return _jit_compile( ^^^^^^^^^^^^^ File "E:\anaconda\Lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile _write_ninja_file_and_build_library( File "E:\anaconda\Lib\site-packages\torch\utils\cpp_extension.py", line 1823, in _write_ninja_file_and_build_library _run_ninja_build( File "E:\anaconda\Lib\site-packages\torch\utils\cpp_extension.py", line 2116, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'wkv'

Process finished with exit code 1

duanduanduanyuchen commented 6 months ago

看起来应该是环境问题,感觉有可能是中文路径问题,或者c++/cuda版本不对。

BlinkDL commented 6 months ago

可以用 Ubuntu 或者 WSL2,在纯win的环境设置会比较复杂