Blade6570 / Learningimage-to-imagetranslationusingpairedandunpairedtrainingsamples

Learning image-to-image translation using paired and unpaired training samples
https://tutvision.github.io/Learning-image-to-image-translation-using-paired-and-unpaired-training-samples/
Other
20 stars 3 forks source link

Getting the below error for cycleGAN mode #3

Closed kalai2033 closed 4 years ago

kalai2033 commented 4 years ago

CustomDatasetDataLoader_super dataset [AlignedDataset] was created

training images = 300

cycle_gan Traceback (most recent call last): File "train.py", line 22, in model = create_model(opt) File "/home/kalai/exp/Learningimage-to-imagetranslationusingpairedandunpairedtrainingsamples/models/models.py", line 7, in create_model from .cycle_gan_model import CycleGANModel File "/home/kalai/exp/Learningimage-to-imagetranslationusingpairedandunpairedtrainingsamples/models/cycle_gan_model.py", line 97 input_A = input_A.cuda(self.gpu_ids[0], async=True) ^ SyntaxError: invalid syntax

Blade6570 commented 4 years ago

What is your PyTorch version?

kalai2033 commented 4 years ago

1.4.0

Blade6570 commented 4 years ago

Hi, my initial guess is that the PyTorch version does not match. The training code is built upon PyTorch 0.3. If you can downgrade the version then that will be great.

kalai2033 commented 4 years ago

Hi, I tried but there is no downloadable file for pytorch 0.3 version

On Wed, May 13, 2020 at 11:28 AM Soumya Tripathy notifications@github.com wrote:

Hi, my initial guess is that the PyTorch version does not match. The training code is built upon PyTorch 0.3. If you can downgrade the version then that will be great.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Blade6570/Learningimage-to-imagetranslationusingpairedandunpairedtrainingsamples/issues/3#issuecomment-627866513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL3DAR33RAMZW4IJIUPYNG3RRJR3ZANCNFSM4M5H5FIQ .

Blade6570 commented 4 years ago

Hi, You have to manually download and install the Pytorch 0.3. It is mentioned here: click here in the (Old) PyTorch Linux binaries compiled with CUDA 7.5 section. As an example, if you want to install torch with python 3.5 then download with wget https://download.pytorch.org/whl/cu75/torch-0.3.0.post4-cp35-cp35m-linux_x86_64.whl then if you have conda, activate the environment with python3.5 and pip then type pip install torch-0.3.0.post4-cp35-cp35m-linux_x86_64.whl to install torch. You can also try our code with torch 0.4.1. But I have not tested with this version.

Please let me know if this works.

kalai2033 commented 4 years ago

I tried with torch 0.4.1. It did not work. It seems i need to downgrade my cuda to 7.5 version for installing pytorch 0.3.1. Is there any chance of you migrating the code to the latest version?

Blade6570 commented 4 years ago

But is it not the case that you can install Cuda-toolkit in your anaconda? Then you can use any Cuda version you need in your virtual environment. At this current moment, I don't think it is possible to migrate my code to the latest version. Maybe in the coming month.

kalai2033 commented 4 years ago

Cudatoolkit 7.5 is not available for ubuntu 18.04. Anyway thanks for your support. Let me know if you migrate your code. image