AI软件下载
有趣网站推荐及实用软件下载

ModuleNotFoundError: No module named 'tinycudann'Windows电脑安装tinycudann模块详细教程

python应用安装报错,部分信息如下:

Traceback (most recent call last):
File “\models\utils.py”, line 10, in
import tinycudann as tcnn
ModuleNotFoundError: No module named ‘tinycudann’

报错信息为缺少tinycudann模块,安装上这个模块就可以了。我的是Windows系统电脑,CUDA为12.4,折腾过程:

看作者发布的PyTorch 扩展版安装方法为执行下面命令安装:

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

我试了下不行,会报错,错误信息有如下等内容

==================================================

File “\site-packages\torch\utils\cpp_extension.py”, line 2121, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tinycudann
Running setup.py clean for tinycudann
Failed to build tinycudann
Installing collected packages: tinycudann
Running setup.py install for tinycudann … error
error: subprocess-exited-with-error

× Running setup.py install for tinycudann did not run successfully.
│ exit code: 1
╰─> [216 lines of output]
Building PyTorch extension for tiny-cuda-nn version 1.7
Obtained compute capability 75 from PyTorch
Detected CUDA version 12.4
Targeting C++ standard 17
running install
site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\crt/host_config.h(248): fatal error C1083: 无法打开包括文件: “crtdefs.h”: No such file or directory

  object.cu

  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "site-packages\torch\utils\cpp_extension.py", line 2105, in _run_ninja_build
      subprocess.run(
    File "\subprocess.py", line 526, 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:

==================================================

继续折腾,网上搜索了一下,看到如下一个解决方案,

先执行下面命令,打开一个新窗口

#此处路径根据自己的文件路径做调整
start "E:\Microsoft\2022\VC\Auxiliary\Build\vcvars64.bat"

在新的vcvars64.bat窗口中执行安装命令:

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

如果你安装成功了的话,那么恭喜你,很幸运,如果你像我一样还是报错的话,可按照下面的方式处理,

点击【开始】找到visual studio 点击启动【x64 Native Tools Command Prompt…】

然后在终端里运行安装命令:

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

OK,终于成功安装tinycudann,太痛苦了,给遇到相同问题的伙伴一点解决思路。

tinycudann项目地址:https://github.com/NVlabs/tiny-cuda-nn

电脑不给力运行不了?试试高配云电脑>>
如需1对1人工答疑支持
爱发电:点击前往
赞(0) 打赏
软件无法使用?点击查看常见问题说明>>

最新发布

ToDesk、青椒云、顺网云、海马云电脑使用体验分享-诺瓦小站

ToDesk、青椒云、顺网云、海马云电脑使用体验分享

最近调试了一些大的AI应用,我那渣渣电脑带不动,又不适合买新电脑,所以网上找了一些高端显卡云电脑作为替代,最近用了几家,如:ToDesk云电脑、青椒云电脑、顺网云电脑、海马云电脑,各有优劣吧,这里总结分享一下使用体验。 云电脑对比分析 海马...

觉得文章对你有帮助就打赏一下作者

非常感谢你的打赏,我将有更多的动力继续提供优质内容,让我们一起创建更加美好的世界!

支付宝扫一扫

微信扫一扫