Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

build error: error: command 'gcc' failed with exit status 1 #567

Closed
githubgsq opened this issue Mar 14, 2019 · 4 comments
Closed

build error: error: command 'gcc' failed with exit status 1 #567

githubgsq opened this issue Mar 14, 2019 · 4 comments

Comments

@githubgsq
Copy link

❓ Questions and Help

hi, all, I'm building the latest maskrcnn version and encountered the problem as follows:
image
I'm using python3.6.6, pytorch1.0.0, gcc/g++ 5.4,
ps. I can successfully build the version downloaded two weeks ago, it's weird. what happened to the new version?

@LeviViana
Copy link
Contributor

LeviViana commented Mar 14, 2019

This is normal, there have been some changes in PyTorch recently, please refer to this thread.

Basically, you've got to install a nightly version of PyTorch. In the official website you have some instructions on how to install a nightly version.

@githubgsq
Copy link
Author

@LeviViana ok, thanks a lot, I'm trying to install pytorch-nightly.

@githubgsq
Copy link
Author

githubgsq commented Mar 14, 2019

I installed pytorch-nightly, and maskrcnn-benchmark can be successfully installed now.
however, when I run the program, I encountered another problem, which indicates that:
image
I found a related issue here: #367 and ensured the nvcc and cuda are of the same version.
But same error still.
Then opened setup.py and found I didn't set CUDA_HOME.
please set your CUDA_HOME and rebuild it, run the program successfully now!
If you have similar questions as I met, I hope this share could help:)

close this issue.

@jerpint
Copy link

jerpint commented Mar 14, 2019

Since the original error was pasted in an image, it was hard for me to find it via google. I am reposting it here with a temporary solution.

/home/jerpint/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp: In lambda function:
/home/jerpint/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp:242:47: error: invalid initialization of reference of type 'const at::Type&' from expression of type 'c10::ScalarType'
   AT_DISPATCH_FLOATING_TYPES(input.scalar_type(), "ROIAlign_forward", [&] {
                                               ^
/miniconda/lib/python3.6/site-packages/torch/lib/include/ATen/Dispatch.h:15:32: note: in definition of macro 'AT_DISPATCH_FLOATING_TYPES'
     const at::Type& the_type = TYPE;                                         \
                                ^
error: command 'gcc' failed with exit status 1

In my case, using a nightly version isn't ideal, since I am using this inside a container for other projects and would like to avoid switching to the nightly build if possible for the time being.

The only temporary workaround I can suggest for now is checking out master before the change was introduced, which at the time of writing this post was only a few days ago. This is not an ideal long-term solution.

To checkout master before the changes, do

git checkout 90080e60cc4a9252d019f475af044c9d4119b09b,

which is the last commit before the change that requires the nightly pytorch build. You should then be able to compile as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants