thomasbrandon / mish-cuda

Mish Activation Function for PyTorch
MIT License
148 stars 67 forks source link

FAILED: xx/xx/mish-cuda-master/build/temp.win-amd64-3.7/Release/csrc/mish_cpu.obj #13

Open mshankr opened 3 years ago

mshankr commented 3 years ago

Hi!

I have trouble installing via: python setup.py install

Software details:

OS: Windows 10 Python: Miniconda 3 Pytorch: 1.7.0 Cuda: 11.0.3 C Tools: Visual Studio 2019

Steps done:

I also tried running python setup.py install in the Command Prompt for VS 2019 I get:

FAILED: xx/xx/mish-cuda-master/build/temp.win-amd64-3.7/Release/csrc/mish_cpu.obj

Full error log:

running install
running bdist_egg
running egg_info
writing src\mish_cuda.egg-info\PKG-INFO
writing dependency_links to src\mish_cuda.egg-info\dependency_links.txt
writing requirements to src\mish_cuda.egg-info\requires.txt
writing top-level names to src\mish_cuda.egg-info\top_level.txt
reading manifest file 'src\mish_cuda.egg-info\SOURCES.txt'
writing manifest file 'src\mish_cuda.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'mish_cuda._C' extension
Emitting ninja build file C:\Users\Admin\Downloads\mish-cuda-master\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -Iexternal -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\torch\csrc\api\include -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\TH -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\ProgramData\Miniconda3\envs\yolov5\include -IC:\ProgramData\Miniconda3\envs\yolov5\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" -c C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish_cpu.cpp /FoC:\Users\Admin\Downloads\mish-cuda-master\build\temp.win-amd64-3.7\Release\csrc/mish_cpu.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Users/Admin/Downloads/mish-cuda-master/build/temp.win-amd64-3.7/Release/csrc/mish_cpu.obj
cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -Iexternal -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\torch\csrc\api\include -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\TH -IC:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\ProgramData\Miniconda3\envs\yolov5\include -IC:\ProgramData\Miniconda3\envs\yolov5\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" -c C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish_cpu.cpp /FoC:\Users\Admin\Downloads\mish-cuda-master\build\temp.win-amd64-3.7\Release\csrc/mish_cpu.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\include\ATen/core/ivalue_inl.h(389): warning C4101: 'e': unreferenced local variable
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2144: syntax error: 'void' should be preceded by ';'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2065: 'scalar_t': undeclared identifier
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2065: 'out': undeclared identifier
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2988: unrecognizable template declaration/definition
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2059: syntax error: 'const'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2143: syntax error: missing ';' before '{'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(17): error C2447: '{': missing function header (old-style formal list?)
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2144: syntax error: 'void' should be preceded by ';'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2065: 'scalar_t': undeclared identifier
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2065: 'grad_inp': undeclared identifier
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2988: unrecognizable template declaration/definition
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2059: syntax error: 'const'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2143: syntax error: missing ';' before '{'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(25): error C2447: '{': missing function header (old-style formal list?)
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(38): error C2144: syntax error: 'void' should be preceded by ';'
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(38): error C2447: '{': missing function header (old-style formal list?)
C:\Users\Admin\Downloads\mish-cuda-master\csrc\mish.h(46): error C2144: syntax error: 'void' should be preceded by ';'
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\utils\cpp_extension.py", line 1522, in _run_ninja_build
    env=env)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "setup.py", line 30, in <module>
    'build_ext': BuildExtension
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
    _build_ext.run(self)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\utils\cpp_extension.py", line 653, in build_extensions
    build_ext.build_extensions(self)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\distutils\command\build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\utils\cpp_extension.py", line 635, in win_wrap_ninja_compile
    with_cuda=with_cuda)
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\utils\cpp_extension.py", line 1238, in _write_ninja_file_and_compile_objects
    error_prefix='Error compiling objects for extension')
  File "C:\ProgramData\Miniconda3\envs\yolov5\lib\site-packages\torch\utils\cpp_extension.py", line 1538, in _run_ninja_build
    raise RuntimeError(message) from e

RuntimeError: Error compiling objects for extension

bostankhan6 commented 3 years ago

I am having the same error :/ Did you resolve it?

knotgrass commented 3 years ago

i think this bug is concert with gcc/g++