-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
everything is good but segmentation fault after program exit #19
Comments
more on this: problem only happens on GPU, if I use CPU (set gpu_count = 0 in config) the problem is gone. |
@huangenyan Hello, could please provide more details: the system do you use, the image you used for evaluation, the type of your GPU, the dump was generated , what type of build (with optimization or not) do you used ... |
I just forget to mention what I use is
GPU is RTX 2080 TI
I also tested which statement cause the segmentation fault, and find problem occurs in std::tuple<torch::Tensor,
torch::Tensor,
torch::Tensor,
torch::Tensor,
torch::Tensor>
FPNImpl::forward(at::Tensor x) {
// no segmentation fault if adding exit(0) here
x = c1_->forward(x);
// segmentation fault if adding exit(0) here
x = c2_->forward(x);
auto c2_out = x;
x = c3_->forward(x);
auto c3_out = x;
x = c4_->forward(x);
auto c4_out = x;
x = c5_->forward(x);
auto p5_out = p5_conv1_->forward(x);
auto p4_out =
p4_conv1_->forward(c4_out) + upsample(p5_out, /*scale_factor*/ 2);
auto p3_out =
p3_conv1_->forward(c3_out) + upsample(p4_out, /*scale_factor*/ 2);
auto p2_out =
p2_conv1_->forward(c2_out) + upsample(p3_out, /*scale_factor*/ 2);
p5_out = p5_conv2_->forward(p5_out);
p4_out = p4_conv2_->forward(p4_out);
p3_out = p3_conv2_->forward(p3_out);
p2_out = p2_conv2_->forward(p2_out);
// P6 is used for the 5th anchor scale in RPN. Generated by subsampling from
// P5 with stride of 2.
auto p6_out = p6_->forward(p5_out);
return {p2_out, p3_out, p4_out, p5_out, p6_out};
} I'm still working on this and hopefully providing more information. |
I create a minimal source file which can reproduce the error: #include <torch/torch.h>
#include <iostream>
#include <memory>
int main(int argc, char** argv) {
auto input = torch::ones({1, 3, 1024, 1024});
input = input.to(torch::DeviceType::CUDA);
auto c2 = torch::nn::Conv2d(torch::nn::Conv2dOptions(3, 64, 7).stride(2).padding(3));
c2->to(torch::DeviceType::CUDA);
c2->forward(input);
return 0;
} The example has nothing to do with your code, so I think it is a bug in pytorch c++ frontend and I'll report an issue there. Thanks! |
I successfully run the demo. When the program exit, I got
[1] 12790 segmentation fault (core dumped) ./mask-rcnn_demo ~/mask_rcnn_coco.dat test.jpg
I think it is caused by some problems during resource releasing or destruction?
Although it is not a big issue, it is a little annoying and hopefully be fixed.
The text was updated successfully, but these errors were encountered: