我是靠谱客的博主 小巧金鱼,最近开发中收集的这篇文章主要介绍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 文件 中 改为下图所示
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?");
可解决此问题
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: command ‘/usr/local/cuda-11.6/bin/nvcc‘ failed with exit codepytorch c++扩展 python setup install 错误解决方法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复