WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 575 forks source link

Can't use mish-cuda in cuda 11.1 #119

Open yunxi1 opened 3 years ago

yunxi1 commented 3 years ago

Hi, My GPU is RTX3090, it's cuda version is 11.1,so I can't install mish-cuda,is there another way to install mish-cuda? or use pytorch mish function:

class Mish(nn.Module): def init(self): super().init() print("Mish activation loaded...") def forward(self,x): x = x * (torch.tanh(F.softplus(x))) return x but I don't know whether speed would be slower than mish-cuda in inference stage?such as FPS

WongKinYiu commented 3 years ago

i am not sure about cuda 11.1, but i can build mish_cuda with cuda 11.0.

yunxi1 commented 3 years ago

I have tried ways: https://github.com/thomasbrandon/mish-cuda and https://github.com/JunnYu/mish-cuda they all failed and I change my mind to use mish function in your code: class Mish(nn.Module): # https://github.com/digantamisra98/Mish def forward(self, x): return x * torch.nn.functional.softplus(x).tanh() but when I load your pretrain model,there is a error:

File "train.py", line 122, in train ckpt = torch.load(weights, map_location=device) # load checkpoint File "/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/serialization.py", line 774, in _legacy_load result = unpickler.load() ModuleNotFoundError: No module named 'mish_cuda' how to solve it if I use your model as pretrain model?

yunxi1 commented 3 years ago

I will try mish_cuda in cuda11.0 again

yunxi1 commented 3 years ago

cuda11.0 failed too this is error ,have you ever encountered this problem? My environment variable is right.

:/usr/local/cuda/bin/nvcc -Iexternal -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/TH -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/THC -I:/usr/local/cuda/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/include/python3.6m -c csrc/mish_kernel.cu -o build/temp.linux-x86_64-3.6/csrc/mish_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' --expt-extended-lambda -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14 unable to execute ':/usr/local/cuda/bin/nvcc': No such file or directory error: command ':/usr/local/cuda/bin/nvcc' failed with exit status 1

ERROR: Failed building wheel for mish-cuda

WongKinYiu commented 3 years ago

what is the command you used to build mish_cuda?

yunxi1 commented 3 years ago

command: python setup.py install
ways: https://github.com/thomasbrandon/mish-cuda or https://github.com/JunnYu/mish-cuda new error: nvcc fatal : Unsupported gpu architecture 'compute_86' error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

WongKinYiu commented 3 years ago

well, it seems compute_86 only supported by cuda>=11.1.

yunxi1 commented 3 years ago

yes, add environment variable:export TORCH_CUDA_ARCH_LIST="7.5" downgrade version it works!

hoangduyloc commented 3 years ago

yes, add environment variable:export TORCH_CUDA_ARCH_LIST="7.5" downgrade version it works!

@yunxi1 Hi there, I stuck install mish-cuda in RTX3090 too export TORCH_CUDA_ARCH_LIST="7.5" downgrade version I don't really get your mean Can you please share with me the steps in details, My Cuda 11.0, RTX3090 Thank you~

yunxi1 commented 3 years ago

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!

hoangduyloc commented 3 years ago

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck! Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

williamhyin commented 3 years ago

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck! Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

hoangduyloc commented 3 years ago

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck! Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

Before I stuck like you also, make sure you delete everything before you install Cuda, PyTorch, mish-cuda "unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory" seems like you're lacking cudnn? Hope that you figure it out soon, and one notice, most of the training results from RTX3090 are always lower than old GPUs like 1080,2080... seems like the newest version is somehow incompatible with NvidiaDriver I think.

williamhyin commented 3 years ago

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck! Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

The issue was solved. I re-installed the cuda 11.0 and correspoding cudnn. The solution: Cuda 11.0+Pytorch 1.70 +python 3.6 + export TORCH_CUDA_ARCH_LIST="8.0" + Nvidia 3090

jishenghuang commented 1 year ago

Install the program to the running build_ ext, this error occurred:[WinError 2] The system cannot find the specified file. What should we do about it

LukeAI commented 1 year ago

Just use yolov7/8 ?


From: hoangduyloc @.> Sent: 30 January 2021 3:58 PM To: WongKinYiu/ScaledYOLOv4 @.> Cc: Subscribed @.***> Subject: Re: [WongKinYiu/ScaledYOLOv4] Can't use mish-cuda in cuda 11.1 (#119)

yes, add environment variable:export TORCH_CUDA_ARCH_LIST="7.5" downgrade version it works!

Hi there, I stuck install mish-cuda in RTX3090 too export TORCH_CUDA_ARCH_LIST="7.5" downgrade version I don't really get your mean Can you please share with me the steps in details, My Cuda 11.0, RTX3090 Thank you~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/WongKinYiu/ScaledYOLOv4/issues/119#issuecomment-770233154, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKPUVMSUZYGEDOH6BFPNOETS4QUCBANCNFSM4VXKHYLA.