'How to run a kind of code like python main.py in terminal?

I used github and copied it by git clone. https://github.com/Zeleni9/pytorch-wgan

but when I run the code:

python main.py --model WGAN-GP \
               --is_train True \
               --download True \
               --dataroot datasets/cifar \
               --dataset cifar \
               --generator_iters 40000 \
               --cuda True \
               --batch_size 64
RuntimeError: Unexpected error from cudaGetDeviceCount(). 
Did you run some cuda functions before calling NumCudaDevices() 
that might have already set an error? Error 2: out of memory

but I can run it on colab without any issue. my terminal can use more GPU than colab. I guess the input code may have some problems? Thank you in adcance.



Solution 1:[1]

commands: 1.: chmod 770 main.py 2.: which python (here you will know which python you have (for example: python3, and it's recommended) 3.: python3 main.py (should work)`

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 netcat