-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 vid2vid on PyTorch 1.0.0 and CUDA 10 #82
Comments
I'm trying to use vid2vid with pytorch 1.0.
|
@francisr I previously got that issue when I had both CUDA 9 and CUDA 10 installed. Make sure the symlink for /usr/local/cuda is pointing to the correct CUDA version, and check to see which version |
I just have CUDA 9 installed on my system. But I gave up and used Pytorch 0.4.1 instead... |
Thanks for the guide. One more thing, if you git clone * flownet2-pytorch repository to flownet2_pytorch and want to train vid2vid, you need add the following codes in flownet2_pytorch/models.py. FlowNet2.init(self, args=None, batchNorm=False, div_flow = 20.)
|
One more thing: I did the git clone method and also had to change the imports in flownet2_pytorch/models.py back to relative imports, e.g. I had to undo the changes made in NVIDIA/flownet2-pytorch@44c8693 BTW this also works great for PyTorch 1.0 and CUDA 9, was finally able to get vid2vid running on V100 GPUs this way. |
Thanks, can you please make a fork of vid2vid / flownet2 that does these things automatically or a Docker image? I really appreciate that. |
Hey @clarle, thanks for the instructions. |
Segmentation fault when execute Anyone meets this problem? |
Hi I have a question with parameter And here is a part of code in flownet-pytorch |
I still get this error:
|
I meet the problem, too. Have you resolved it? |
here is my script to make it run: nvidia-smi: nvcc --version: conda create -n vid2vid python=3.6 add 'edge = edge.bool()' to models/base_model.py:ln 148 python scripts/download_datasets.py check in python: import torch, import resample2d_cuda, see if there's any problem python scripts/street/download_models.py |
Below setup worked for me: conda remove --name vid2vid --all conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch pip install dominate requests Training (need approx. 15GB GPU)python train.py --name edge2face_512 --dataroot datasets/face/ --dataset_mode face --input_nc 15 --loadSize 512 --num_D 3 --gpu_ids 0 --n_gpus_gen 1 --n_frames_total 12 Testingpython test.py --name edge2face_512 --dataroot datasets/face/ --dataset_mode face --input_nc 15 --loadSize 512 --use_single_G |
I have tried this solution but didn't work for me. Error: ------------ Options -------------
|
@moulimatsa Were you able to solve this? I'm getting the same error? |
I thought this might help a few people, though feel free to remove this if you think it doesn't belong in the issues tracker.
I was trying to run vid2vid on PyTorch 1.0.0 and CUDA 10, now that 1.0.0 was stable. I was able to successfully do it by making a few changes to the downloaded flownet2_pytorch snapshot.
Instructions
First, download all of the dependencies needed for vid2vid, substituting CUDA 10 and PyTorch 1.0.0 instead of CUDA 9.x and PyTorch 0.4.x.
Clone the vid2vid repository.
Continue to download the datasets with
python scripts/download_datasets.py
.At this point, there are two options:
git clone
the flownet2-pytorch repository directly into themodels
folder in vid2vid toflownet2_pytorch
(recommended)Alternatively:
download_flownet2.py
file fromif torch.__version__ == '0.4.1':
toif torch.__version__ == '1.0.0':
python scripts/download_flownet2.py
. You'll get some compilation errors and warnings as the current version of flownet2 is still designed for the earlier version of Torch.Go to
models/flownet2_pytorch
and make the changes in this pull request:#include <ATen/cuda/CUDAContext.h>
and then replacingat::globalContext().getCurrentCUDAStream()
withat::cuda::getCurrentCUDAStream()
in each of the three sub-packages -channelnorm-cuda
,correlation-cuda
, andresample2d-cuda
.Rebuild flownet2 after making those changes with
bash install.sh
inside themodels/flownet2_pytorch
folder. It should now compile successfully with PyTorch 1.0.0.You can now run vid2vid following the rest of the instructions. I was able to get this working on CUDA 10, PyTorch 1.0.0, on a RTX 2080 TI.
If there's any interest, I can make a fork of vid2vid / flownet2 that does these things automatically as well or a Docker image.
Thanks @jiapei100 for the original PR to flownet2 - saved me a lot of time from trying to dig through the new PyTorch API changes there.
The text was updated successfully, but these errors were encountered: