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

Running in Google Colab #31

Open
HanClinto opened this issue Aug 6, 2020 · 8 comments
Open

Running in Google Colab #31

HanClinto opened this issue Aug 6, 2020 · 8 comments

Comments

@HanClinto
Copy link

HanClinto commented Aug 6, 2020

Initially I had some trouble running this code in Google Colab, but eventually got it to work and wanted to share my notebook in case others would find this useful:

https://gist.github.com/HanClinto/49219942f76d5f20990b6d048dbacbaf

Eventually it might be nice to clean this up a bit more and put it into the repo as an included "quick start" for users.

Note that you will need to run on a Colab VM with GPU support, and it helps if you tick the "High RAM" option as well. Note that I ran out of memory when attempting to process a video of resolution 480x848, but when I switched to a video that was only 320x564 then it was able to complete after I set the command-line option of --N_out 3

Thank you so very much for this code -- it's very well done!

@HanClinto
Copy link
Author

Note: Here is the file that I could not get to process without running out of memory -- it would be really nice to be able to process larger videos like this:

https://drive.google.com/file/d/1o2dXzchZGa1hsep8z9NKLn411_cU6jfV/view?usp=sharing

@Mukosame
Copy link
Owner

Mukosame commented Aug 6, 2020

Hi @HanClinto , thanks for your comments! I'm sure your gist would be very helpful for other ones.
As for the OOM issue, I recalled that it was also mentioned in previous issues. Thanks for your detailed feedback and the provided video again. I will try to modify my code to make it more memory-efficient for video processing.

@freedomlyle
Copy link

I'm suffering from a problem with the window system that prevents me from running the project.But the approach you suggested allowed me to successfully test the project, thank you so much for your selfless dedication!

@HanClinto
Copy link
Author

@freedomlyle Very glad to hear it was helpful, thank you! :)

@mpriessner
Copy link

Hello everyone!

@Mukosame: Thank you for this amazing work. It is fascinating how well the interpolation works.
@HanClinto: thanks for sharing the code for the Colab notebook - it works very well for the testing.

I am trying to train a new model from scratch with just 2x magnification on google colab and I run into some problems here.
When I use thetorch==1.4.0 torchvision==0.5.0 as done by HanClinto I get the following error when running:
!python train.py -opt options/train/train_zsm.yml

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:50

I also tried to exchange the DCNv2 for a different version provided from:
https://github.com/jinfagang/DCNv2_latest.git
which works also fine with torch==1.5.0+cu101 torchvision==0.6.0+cu101 and normal pytorch 1.6 for the interpolation of videos but when I try the training again I get the following error:

THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=47 error=100 : no CUDA-capable device is detected terminate called after throwing an instance of 'std::runtime_error' what(): cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:47

When trying torch==1.2.0 torchvision==0.4.0 with installing pillow==6.1 (otherwise Pillow==6.1 error) I got the following error:
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:50

All the trails the torch.cuda.is_available() gives me "True". Therefore I don't understand why I get these errors.
The grafic card is: Tesla V100-SXM2-16GB

Does anyone know how to solve this problem?
Thank you!

@mpriessner
Copy link

I actually found out the solution myself. :)

It is as simple as changing the line 8 in train_zsm.yml

from
gpu_ids: [2]
to
gpu_ids: [0]

because Google Colab just provides one GPU instead of three.
I hope in case anyone else runs into that problem that this comment helps.

@noobtoob4lyfe
Copy link

This no longer works. please update or delete

@HanClinto
Copy link
Author

This no longer works. please update or delete

@noobtoob4lyfe what error are you having?

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

5 participants