我是靠谱客的博主 小巧金鱼,这篇文章主要介绍error: command ‘/usr/local/cuda-11.6/bin/nvcc‘ failed with exit codepytorch c++扩展 python setup install 错误解决方法,现在分享给大家,希望可以做个参考。

pytorch c++扩展 python setup install 错误

解决方法

将/home/zyc/miniconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch 下cloneable。h 文件 中 改为下图所示

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
TORCH_CHECK( copy->parameters_.size() == this->parameters_.size(), "The cloned module does not have the same number of " "parameters as the original module after calling reset(). " "Are you sure you called register_parameter() inside reset() " "and not the constructor?"); for (const auto& parameter : named_parameters(/*recurse=*/false)) { auto& tensor = *parameter; auto data = device && tensor.device() != *device ? tensor.to(*device) : autograd::Variable(tensor).clone(); copy->parameters_[parameter.key()].set_data(data); } TORCH_CHECK( copy->buffers_.size() == this->buffers_.size(), "The cloned module does not have the same number of " "buffers as the original module after calling reset(). " "Are you sure you called register_buffer() inside reset() " "and not the constructor?"); for (const auto& buffer : named_buffers(/*recurse=*/false)) { auto& tensor = *buffer; auto data = device && tensor.device() != *device ? tensor.to(*device) : autograd::Variable(tensor).clone(); copy->buffers_[buffer.key()].set_data(data); } TORCH_CHECK( copy->children_.size() == this->children_.size(), "The cloned module does not have the same number of " "child modules as the original module after calling reset(). " "Are you sure you called register_module() inside reset() " "and not the constructor?");

可解决此问题

复制代码
1
2
3
4
5
6
7
8
9
10
removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing chamfer-0.0.0-py3.7-linux-x86_64.egg removing '/home/zyc/miniconda3/lib/python3.7/site-packages/chamfer-0.0.0-py3.7-linux-x86_64.egg' (and everything under it) creating /home/zyc/miniconda3/lib/python3.7/site-packages/chamfer-0.0.0-py3.7-linux-x86_64.egg Extracting chamfer-0.0.0-py3.7-linux-x86_64.egg to /home/zyc/miniconda3/lib/python3.7/site-packages chamfer 0.0.0 is already the active version in easy-install.pth Installed /home/zyc/miniconda3/lib/python3.7/site-packages/chamfer-0.0.0-py3.7-linux-x86_64.egg Processing dependencies for chamfer==0.0.0 Finished processing dependencies for chamfer==0.0.0

出现此信息提示表示成功

最后

以上就是小巧金鱼最近收集整理的关于error: command ‘/usr/local/cuda-11.6/bin/nvcc‘ failed with exit codepytorch c++扩展 python setup install 错误解决方法的全部内容,更多相关error:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部