Real-ESRGAN icon indicating copy to clipboard operation
Real-ESRGAN copied to clipboard

segmentation fault when running from a different folder on Mac

Open sergey-kritskiy opened this issue 2 years ago • 3 comments

I'm using the portable version on a Mac. If I open Terminal on the realesrgan folder and run ./realesrgan-ncnn-vulkan -i /path/to/input.jpg -o /path/to/output.jpg it works. However if I run it from any other folder, for example

cd ..
./realesrgan-ncnn-vulkan-20220424-macos/realesrgan-ncnn-vulkan -i /path/to/input.jpg -o /path/to/output.jpg

I'm getting a segmentation error: zsh: segmentation fault ./realesrgan-ncnn-vulkan-20220424-macos/realesrgan-ncnn-vulkan -i /path/to/input.jpg - Running from a different folder on Windows works fine. I was wondering if there's a way to avoid this on my side or fix on your side? Thank you.

sergey-kritskiy avatar Sep 13 '22 07:09 sergey-kritskiy

Look the settings

Emanuelcarvalho2004 avatar Sep 14 '22 21:09 Emanuelcarvalho2004

Look the settings

I don't know what you mean by that. Settings of what?

sergey-kritskiy avatar Sep 15 '22 08:09 sergey-kritskiy

I do not have the mac environment. To wait for someone else to fix it 😃

xinntao avatar Sep 20 '22 12:09 xinntao

@sergey-kritskiy seems you need to specify the complete path of the models using the -m flag when using the command on files outside of its root folder.

hay avatar Jan 21 '23 21:01 hay

@hay oh wow, thank you for the tip, it worked! I also had to provide full paths to input and output images

sergey-kritskiy avatar Jan 23 '23 13:01 sergey-kritskiy

python3 inference_realesrgan.py -n RealESRGAN_x4plus -i input.png -o output.png -s 2 --fp32

i have same problem

rkhyper avatar Oct 25 '23 10:10 rkhyper

@hay oh wow, thank you for the tip, it worked! I also had to provide full paths to input and output images

care to give an example for a run command that worked?

david1asher avatar Jan 12 '24 00:01 david1asher