interactive-deep-colorization icon indicating copy to clipboard operation
interactive-deep-colorization copied to clipboard

gpu [GPU_ID]??? Interactive Deep Colorization windows 10 64-bit

Open HoaBi11 opened this issue 5 years ago • 12 comments

Hello!

I want to use Interactive Deep Colorization but I can't run the command line below to run the UI

           python ideepcolor.py --gpu [GPU_ID] --backend [CAFFE OR PYTORCH]

I don't know [GPU_ID] is what.

I use windows 10 64-bit.

I use Pytorch.

How can I find GPU ID?

Thank you for your support!

icolor

HoaBi11 avatar May 22 '20 10:05 HoaBi11

Can I run the command line in CPU mode with Pytorch? If yes, how to do it?

I don't have Nvidia GPU so can't run the command line in GPU mode.

HoaBi11 avatar May 22 '20 22:05 HoaBi11

You can add a flag --cpu_mode. It will work but it will be quite slow. If you just want to colorize your photo on Windows platform. you can use Adobe PSE. See this blog.

junyanz avatar May 24 '20 00:05 junyanz

Maybe I have to try again with caffe! (-_-)

image

HoaBi11 avatar May 25 '20 18:05 HoaBi11

Thank you for your answer!

I realy realy like this project of you. (^_^)

I don't have any knowledge on programming so it's so hard to install for me.

HoaBi11 avatar May 25 '20 19:05 HoaBi11

Can you help me, junyan!

image

HoaBi11 avatar May 26 '20 21:05 HoaBi11

Maybe you want to double-check if the image test_imgs/mortar_pestle.jpg is in your directory. Maybe you need to rename the file according to Windows format.

junyanz avatar May 27 '20 03:05 junyanz

Thank you for that!

But I don't know I should do what, filename default was correct format.

Images

HoaBi11 avatar May 27 '20 16:05 HoaBi11

I am not familiar with the Windows file path format. You should just go to python, and then debug the function cv2.imread. If you are not familiar with Python, you can use PSE directly.

python
import cv2
img=cv2.imread("your_test_image_path")

junyanz avatar May 27 '20 19:05 junyanz

I'm using windows too, I had to change it as you said in gui_draw.py and colorize_image.py im = cv2.cvtColor(cv2.imread("./test_imgs/mortar_pestle.jpg"), cv2.COLOR_BGR2RGB) im_bgr = cv2.imread("./test_imgs/mortar_pestle.jpg")

But when I run it to show the UI, it just doesn't appear anything, and without errors:

(base) C:\Users\user\Documents\ideepcolor>python ideepcolor.py --gpu 0 --backend pytorch [win_size] = 512 [image_file] = test_imgs/mortar_pestle.jpg [gpu] = 0 [cpu_mode] = False [color_prototxt] = ./models/reference_model/deploy_nodist.prototxt [color_caffemodel] = ./models/reference_model/model.caffemodel [dist_prototxt] = ./models/reference_model/deploy_nopred.prototxt [dist_caffemodel] = ./models/reference_model/model.caffemodel [color_model] = ./models/pytorch/caffemodel.pth [backend] = pytorch [pytorch_maskcent] = False [load_size] = 256 ColorizeImageTorch instantiated path = ./models/pytorch/caffemodel.pth Model set! dist mode? False ColorizeImageTorch instantiated path = ./models/pytorch/caffemodel.pth Model set! dist mode? True b'test_imgs/mortar_pestle.jpg' scale = 2.000000 (base) C:\Users\user\Documents\ideepcolor>

And only using gpu 0, if I use gpu 1, I got an error of tensors weight. I had to say that in jupyter notebook, it works fine removing the comments of cuda(), but my problem is to run the UI

alex-montano avatar Jun 08 '20 02:06 alex-montano

Not sure. If you only have one GPU, you should use gpu 0. You can also try cpu model with --cpu_mode.

junyanz avatar Jun 08 '20 03:06 junyanz

Thank you for the response. I have 2 GPU, but I can't open de UI, and I got no errors, as I said before.

alex-montano avatar Jun 08 '20 13:06 alex-montano

@HoaBi11 , @amontanoa I just got that error (imread failing) - if it helps, I got around it by adding:

image_file = image_file.decode("utf-8") before imread is called, since the image filepath is in binary format. That got the UI showing, but doesn't seem to update once colour points are added though...

nikhilwoodruff avatar Jul 22 '20 20:07 nikhilwoodruff