thomasbrandon / mish-cuda

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

mish.h syntax errors #14

Open armanm01 opened 3 years ago

armanm01 commented 3 years ago

when trying to run setup.py i get the following error. C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2144: syntax error: 'void' should be preceded by ';' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2065: 'scalar_t': undeclared identifier C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2065: 'out': undeclared identifier C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2988: unrecognizable template declaration/definition C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2059: syntax error: 'const' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2143: syntax error: missing ';' before '{' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(17): error C2447: '{': missing function header (old-style formal list?) C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2144: syntax error: 'void' should be preceded by ';' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2065: 'scalar_t': undeclared identifier C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2065: 'grad_inp': undeclared identifier C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2988: unrecognizable template declaration/definition C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2059: syntax error: 'const' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2143: syntax error: missing ';' before '{' C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(25): error C2447: '{': missing function header (old-style formal list?) C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(40): error C2062: type 'float' unexpected C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(41): error C2065: 'res': undeclared identifier C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(48): error C2062: type 'float' unexpected C:\Users\arman\Desktop\Arman\cowc-everything\scaled_yolov4_p6\mish-cuda\csrc\mish.h(49): error C2065: 'res': undeclared identifier C:\Users\arman\Anaconda3\lib\site-packages\torch\include\ATen/Parallel.h(43): error C2039: 'init_num_threads': is not a member of 'at' C:\Users\arman\Anaconda3\lib\site-packages\torch\include\ATen/Parallel.h(7): note: see declaration of 'at' C:\Users\arman\Anaconda3\lib\site-packages\torch\include\ATen/Parallel.h(43): error C3861: 'init_num_threads': identifier not found error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2

Installing on Windows 10

Andrej-sens commented 3 years ago

Facing the same issue. It looks like scalar_t is undefined type and my guess is that should be defined in torch/types.h. Isn't this a version problem?