nianticlabs / monodepth2

[ICCV 2019] Monocular depth estimation from a single image
Other
4.13k stars 953 forks source link

RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS #493

Open kuacboss opened 6 months ago

kuacboss commented 6 months ago

I installed it with this code conda create -n monodepth2 python=3.6.6 conda install pytorch=0.4.1 torchvision=0.2.1 -c pytorch pip install tensorboardX==1.4 conda install opencv=3.3.1 # just needed for evaluation

python test_simple.py --image_path assets/test_image.jpg --model_name mono+stereo_640x192 --pred_metric_depth -> Loading model from models/mono+stereo_640x192 Loading pretrained encoder Loading pretrained decoder -> Predicting on 1 test images Traceback (most recent call last): File "test_simple.py", line 171, in test_simple(args) File "test_simple.py", line 132, in test_simple features = encoder(input_image) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self. forward(*input, *kwargs) File "/home/sm99/monodepth2/networks/resnet_encoder.py", line 90, in forward x = self.encoder.conv1(x) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self. forward(input, **kwargs) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward self.padding, self.dilation, self.groups) RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS

This error occurs: But when I run it with -no_cuda it runs fine.

please help me....

19991105 commented 6 months ago

I installed it with this code conda create -n monodepth2 python=3.6.6 conda install pytorch=0.4.1 torchvision=0.2.1 -c pytorch pip install tensorboardX==1.4 conda install opencv=3.3.1 # just needed for evaluation

python test_simple.py --image_path assets/test_image.jpg --model_name mono+stereo_640x192 --pred_metric_depth -> Loading model from models/mono+stereo_640x192 Loading pretrained encoder Loading pretrained decoder -> Predicting on 1 test images Traceback (most recent call last): File "test_simple.py", line 171, in test_simple(args) File "test_simple.py", line 132, in test_simple features = encoder(input_image) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self. forward(*input, kwargs) File "/home/sm99/monodepth2/networks/resnet_encoder.py", line 90, in forward x = self.encoder.conv1(x) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call* result = self. forward(input, **kwargs) File "/home/sm99/anaconda3/envs/monodepth2/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward self.padding, self.dilation, self.groups) RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS

This error occurs: But when I run it with -no_cuda it runs fine.

please help me....

Hi,I have the same problem.Have you solve it?

zengy5 commented 4 months ago

@19991105 hi,I may found the solution My cuda version is cuda 9.0, which can be seen with command "nvcc -V" If your cuda version isn't cuda9.0, maybe it can not help, but I suggest you to try add the following code into "test_simple.py ", right behind import ended. torch.backends.cudnn.benchmark = True

Hope this can help you.

li12138cmd commented 2 weeks ago

I have encountered this problem, I solved it, I am running this project in a container, my host CUDA is 12.2, I have tried to install 12.2, 11.4, 11.6 version of CUDA in the container, and at the same time configure the corresponding CUDNN, this problem will occur. In the end, my successful method, first of all, I must install CUDA and the corresponding version of CUDNN, install the corresponding CUDA version of torch and torchvision, I use the CUDA version of 12.2, and install the corresponding torch package of 12.1 on the official website of torch, and the error will not appear after configuration