DeepCrack icon indicating copy to clipboard operation
DeepCrack copied to clipboard

Testing the pre-trained model

Open hamza233 opened this issue 2 years ago • 1 comments

I'm trying to test the pre-trained model on some images. What is the input of the model in test_index.txt? The path in train_example.txt is like: /home/yueyuanhao/deepcrack/data/CrackTree/crack_train_image/6192_rot0_crop1_mirror0.jpg /home/yueyuanhao/deepcrack/data/CrackTree/crack_train_mask/6192_rot0_crop1_mirror0.png

Do we need a pair of images for testing as well or single image separated by space?

I tested with space separated paths of images, but it is giving the following error:

RuntimeError: CUDA out of memory. Tried to allocate 378.00 MiB (GPU 0; 10.76 GiB total capacity; 9.19 GiB already allocated; 54.44 MiB free; 9.59 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

hamza233 avatar May 05 '22 15:05 hamza233

Maybe you can use the os library to get the path to the picture, and then use the loop to write to the txt file. like this file test_example.txt in your error,maybe you can set the num_worker=0 or 1,or reduce the size of your image when you read the image

dys-c avatar Sep 05 '22 09:09 dys-c

I'm triying to test the pre-trained model 'DeepCrack_CT260_FT1.pth'. The results are something like this image

I want to use your code to figure out some 'crack detection' tasks in my reasearch field. Can you help me?

supersrh avatar Nov 27 '22 08:11 supersrh

This is a problem raised by your GPU or CUDA settings. You can set the CPU as the computing unit to generate results for comparison.

qinnzou avatar Dec 06 '22 09:12 qinnzou

Solved, thanks! LOL

supersrh avatar Dec 06 '22 09:12 supersrh