jukebox icon indicating copy to clipboard operation
jukebox copied to clipboard

syntax error

Open jasonburnell98 opened this issue 5 years ago • 5 comments

When I try to enter these commands:

python jukebox/sample.py --model=1b_lyrics --name=sample_1b --levels=3 --sample_length_in_seconds=20 > --total_sample_length_in_seconds=180 --sr=44100 --n_samples=16 --hop_fraction=0.5,0.5,0.125

I get the following error:

File "jukebox/sample.py", line 45 print_once(f"Sampling {sample_tokens} tokens for [{start},{start+sample_tokens}]. Conditioning on {conditioning_tokens} tokens") ^ SyntaxError: invalid syntax

Any help is appreciated.

jasonburnell98 avatar May 15 '20 19:05 jasonburnell98

What version of python are you using?

christopherhesse avatar May 17 '20 07:05 christopherhesse

3.8.1. It’s odd if I try to compile with python3 I get a torch error even though I have pytorch installed version 1.1 I think

jasonburnell98 avatar May 18 '20 00:05 jasonburnell98

sorry, i meant python 3.7.6

jasonburnell98 avatar May 18 '20 01:05 jasonburnell98

I encountered the same thing. I then performed the following to address the error

Modified line 45 from print_once(f"Sampling {sample_tokens} tokens for [{start},{start+sample_tokens}]. Conditioning on {conditioning_tokens} tokens") to print_once(f"Sampling {sample_tokens} tokens for [{start}, {start+sample_tokens}]. Conditioning on {conditioning_tokens} tokens") Added a space after the comma, not sure it was vital too.

I then updated the file permissions with chmod +x sample.py then from the directory run this command

python sample.py --model=5b_lyrics --name=sample_5b --levels=3 --sample_length_in_seconds=20 --total_sample_length_in_seconds=180 --sr=44100 --n_samples=6 --hop_fraction=0.5,0.5,0.125

Got this error in place of the line 45 SyntaxError: invalid syntax...so some progress

Using cuda False THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1556653114079/work/torch/csrc/cuda/Module.cpp line=33 error=38 : no CUDA-capable device is detected Caught error during NCCL init (attempt 0 of 5): cuda runtime error (38) : no CUDA-capable device is detected at /opt/conda/conda-bld/pytorch_1556653114079/work/torch/csrc/cuda/Module.cpp:33 Caught error during NCCL init (attempt 1 of 5): trying to initialize the default process group twice! Caught error during NCCL init (attempt 2 of 5): trying to initialize the default process group twice! Caught error during NCCL init (attempt 3 of 5): trying to initialize the default process group twice! Caught error during NCCL init (attempt 4 of 5): trying to initialize the default process group twice! Traceback (most recent call last): File "sample.py", line 275, in fire.Fire(run) File "/home/johnniea/anaconda3/lib/python3.7/site-packages/fire/core.py", line 127, in Fire component_trace = _Fire(component, args, context, name) File "/home/johnniea/anaconda3/lib/python3.7/site-packages/fire/core.py", line 366, in _Fire component, remaining_args) File "/home/johnniea/anaconda3/lib/python3.7/site-packages/fire/core.py", line 542, in _CallCallable result = fn(*varargs, **kwargs) File "sample.py", line 267, in run rank, local_rank, device = setup_dist_from_mpi(port=port) File "/home/johnniea/Documents/GitHub/jukebox/jukebox/utils/dist_utils.py", line 46, in setup_dist_from_mpi return _setup_dist_from_mpi(master_addr, backend, port, n_attempts, verbose) File "/home/johnniea/Documents/GitHub/jukebox/jukebox/utils/dist_utils.py", line 101, in _setup_dist_from_mpi raise RuntimeError("Failed to initialize NCCL") RuntimeError: Failed to initialize NCCL

BuzzAldrinsPunch avatar Jun 07 '20 08:06 BuzzAldrinsPunch

Yup, also seeing

Caught error during NCCL init (attempt 0 of 5): trying to initialize the default process group twice!
Caught error during NCCL init (attempt 1 of 5): trying to initialize the default process group twice!
Caught error during NCCL init (attempt 2 of 5): trying to initialize the default process group twice!
Caught error during NCCL init (attempt 3 of 5): trying to initialize the default process group twice!
Caught error during NCCL init (attempt 4 of 5): trying to initialize the default process group twice!
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-21-ec93396d27b8> in <module>()
      9 from jukebox.utils.dist_utils import setup_dist_from_mpi
     10 from jukebox.utils.torch_utils import empty_cache
---> 11 rank, local_rank, device = setup_dist_from_mpi()

1 frames
/usr/local/lib/python3.7/dist-packages/jukebox/utils/dist_utils.py in _setup_dist_from_mpi(master_addr, backend, port, n_attempts, verbose)
     99             pass
    100 
--> 101     raise RuntimeError("Failed to initialize NCCL")

RuntimeError: Failed to initialize NCCL

atav32 avatar Jul 12 '21 21:07 atav32