Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HoaBi11 opened this issue May 22, 2020 · 12 comments
Open

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

HoaBi11 opened this issue May 22, 2020 · 12 comments

Comments

@HoaBi11
Copy link

HoaBi11 commented May 22, 2020

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 HoaBi11 closed this as completed May 22, 2020
@HoaBi11 HoaBi11 reopened this May 22, 2020
@HoaBi11
Copy link
Author

HoaBi11 commented May 22, 2020

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.

@junyanz
Copy link
Owner

junyanz commented May 24, 2020

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.

@HoaBi11
Copy link
Author

HoaBi11 commented May 25, 2020

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

image

@HoaBi11
Copy link
Author

HoaBi11 commented May 25, 2020

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
Copy link
Author

HoaBi11 commented May 26, 2020

Can you help me, junyan!

image

@junyanz
Copy link
Owner

junyanz commented May 27, 2020

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.

@HoaBi11
Copy link
Author

HoaBi11 commented May 27, 2020

Thank you for that!

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

Images

@junyanz
Copy link
Owner

junyanz commented May 27, 2020

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")

@alex-montano
Copy link

alex-montano commented Jun 8, 2020

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

@junyanz
Copy link
Owner

junyanz commented Jun 8, 2020

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

@alex-montano
Copy link

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.

@nikhilwoodruff
Copy link

@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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants