mmgeneration icon indicating copy to clipboard operation
mmgeneration copied to clipboard

Got error "subprocess.CalledProcessError: Command 'gcc --version | head -n1' returned non-zero exit status 255."

Open KeranLi opened this issue 2 years ago • 5 comments

Hi! I got an error "subprocess.CalledProcessError: Command 'gcc --version | head -n1' returned non-zero exit status 255."

The whole information is like:

F:\Anaconda3\envs\openmmlab\python.exe F:/code/openmmlab/mmgeneration/tools/train.py F:\code\openmmlab\mmgeneration\configs\cyclegan\cyclegan_Isgan_id0_resnet_in_blank2raw.py F:/code/openmmlab/mmgeneration/tools/train.py:98: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. f'Setting OMP_NUM_THREADS environment variable for each process ' F:/code/openmmlab/mmgeneration/tools/train.py:108: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. f'Setting MKL_NUM_THREADS environment variable for each process ' 'tail' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ��� 'gcc' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ��� Traceback (most recent call last): File "F:/code/openmmlab/mmgeneration/tools/train.py", line 228, in main() File "F:/code/openmmlab/mmgeneration/tools/train.py", line 179, in main env_info_dict = collect_env() File "f:\code\openmmlab\mmgeneration\mmgen\utils\collect_env.py", line 50, in collect_env gcc = subprocess.check_output('gcc --version | head -n1', shell=True) File "F:\Anaconda3\envs\openmmlab\lib\subprocess.py", line 411, in check_output **kwargs).stdout File "F:\Anaconda3\envs\openmmlab\lib\subprocess.py", line 512, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command 'gcc --version | head -n1' returned non-zero exit status 255.

Hoping more info about this error! Thanks!

KeranLi avatar Jun 15 '22 05:06 KeranLi

Hi @KeranLi, can you run gcc --version | head -n1 and show me the output?

plyfager avatar Jun 16 '22 02:06 plyfager

Hi @plyfager! the cmd shows 'gcc' 不是内部或外部命令,也不是可运行的程序或批处理文件。Do this mean I have to install gcc and several related packages?

KeranLi avatar Jun 16 '22 03:06 KeranLi

Same issue for me, any solution?

oschan77 avatar Jun 20 '22 08:06 oschan77

This is caused by gcc --version output being different between Windows and Ubuntu. We will fix this later. A temporary solution is to remove the following lines: https://github.com/open-mmlab/mmgeneration/blob/6bce6ed0315438b3f7955019a2c6a64078cfd0e8/mmgen/utils/collect_env.py#L50-L52

LeoXing1996 avatar Jun 20 '22 14:06 LeoXing1996

Thanks! it works!

KeranLi avatar Jun 21 '22 14:06 KeranLi