magenta / ddsp

DDSP: Differentiable Digital Signal Processing
https://magenta.tensorflow.org/ddsp
Apache License 2.0
2.92k stars 341 forks source link

Occasional trouble downloading model zip file #69

Open kcbuilder01 opened 4 years ago

kcbuilder01 commented 4 years ago

Hey, getting an issue when I try to run the upload function in the timbre transfer demo I run the cell, choose the file to upload then get this error

MessageError Traceback (most recent call last)

in () 10 # Load audio sample here (.mp3 or .wav3 file) 11 # Just use the first file. ---> 12 filenames, audios = upload() 13 audio = audios[0] 14 audio = audio[np.newaxis, :] 3 frames /usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec) 104 reply.get('colab_msg_id') == message_id): 105 if 'error' in reply: --> 106 raise MessageError(reply['error']) 107 return reply.get('data', None) 108 MessageError: RangeError: Maximum call stack size exceeded. Pls help, thanks!
jesseengel commented 4 years ago

Hmm, never seen that before. Do you have the file that you're trying to upload so we can reproduce?

kcbuilder01 commented 4 years ago

here's the file, just a simple mp3 pluck sound, thanks! sound transfer test.mp3.zip

kcbuilder01 commented 4 years ago

I just tried to run it inside google chrome and that step works there, but now when I go to the next step to upload my custom checkpoint folder I get this directory error:

`--------------------------------------------------------------------------- UnboundLocalError Traceback (most recent call last)

in () 35 print("Unzipping... {}".format(fnames)) 36 get_ipython().system('unzip -o "/content/$fnames" -d $UPLOAD_DIR &> /dev/null') ---> 37 model_dir = find_model_dir(UPLOAD_DIR) 38 gin_file = os.path.join(model_dir, 'operative_config-0.gin') 39 in find_model_dir(dir_name) 12 model_dir = root 13 break ---> 14 return model_dir 15 16 UnboundLocalError: local variable 'model_dir' referenced before assignment`
jesseengel commented 4 years ago

I just went through the whole process (including training a model) using the sample you uploaded. I was able to successfully upload the audio and a newly trained model and generate audio. I did get your error if the loading dialog was left open too long (it times-out automatically, which is unfortunate), but it worked fine if I just run the cell again and open the load dialog again.

kcbuilder01 commented 4 years ago

thanks for your reply and for trying it out. should i be able to open my checkpoint folder on my desktop? When i try to, I get an error saying the directory or file cannot be found. I think my problem may be stemming from the checkpoint folder not downloading properly onto my machine, then when I reupload it in the timbre transfer demo, it doesnt work.

kcbuilder01 commented 4 years ago

I'm also getting this error: UnboundLocalError: local variable 'model_dir' referenced before assignment when trying to upload my own model/checkpoint folder

jesseengel commented 4 years ago

The notebook has been tested with checkpoints / folders zipped from the other demo notebook train_autoencoder.ipynb. You might want to check out the last cell of that notebook for reference.

kcbuilder01 commented 4 years ago

thanks! I trained the autoencoder again and when I download my checkpoint it says this, does this look normal to you:

updating: ckpt-60000.data-00000-of-00002 (deflated 90%) updating: ckpt-60000.data-00001-of-00002 (deflated 7%) updating: ckpt-60000.index (deflated 79%) updating: operative_config-0.gin (deflated 75%)

Exception happened during processing of request from ('::ffff:127.0.0.1', 47642, 0, 0) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.6/socketserver.py", line 724, in init self.handle() File "/usr/lib/python3.6/http/server.py", line 418, in handle self.handle_one_request() File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request method() File "/usr/lib/python3.6/http/server.py", line 639, in do_GET self.copyfile(f, self.wfile) File "/usr/lib/python3.6/http/server.py", line 800, in copyfile shutil.copyfileobj(source, outputfile) File "/usr/lib/python3.6/shutil.py", line 82, in copyfileobj fdst.write(buf) File "/usr/lib/python3.6/socketserver.py", line 803, in write self._sock.sendall(b) ConnectionResetError: [Errno 104] Connection reset by peer

jesseengel commented 4 years ago

Hmm, it looks like the colab notebook is timing out on you. I haven't seen that yet, but there is definitely some variance in the instances pulled up for each colab, so you might actually have some luck trying to download again. Alternatively, if you've been writing everything to your google drive, you should be able to just download the directory from your drive and execute the zip command from the notebook locally.

kcbuilder01 commented 4 years ago

Thanks I did this and it worked! For whatever reason it didn’t download correctly from the Colab so dloading from google drive def helped.

Sent from my iPhone

On Apr 5, 2020, at 10:46 PM, Jesse Engel notifications@github.com wrote:

 Hmm, it looks like the colab notebook is timing out on you. I haven't seen that yet, but there is definitely some variance in the instances pulled up for each colab, so you might actually have some luck trying to download again. Alternatively, if you've been writing everything to your google drive, you should be able to just download the directory from your drive and execute the zip command from the notebook locally.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jesseengel commented 4 years ago

Nice! Glad it worked.

ioannist commented 4 years ago

I am uploading a zip file generated and downloaded from train_autoencoder.ipynb colab notebook that passed the resynthesis tests.

I am getting the same model_dir error in timbre_transfer.ipynb colab notebook when i try to upload the custom model. I tried running the cell a few times, factory reset, and returning root inside find_model_dir (lead to None error). Any ideas?

<ipython-input-3-43885a901aa1> in find_model_dir(dir_name) 12 model_dir = root 13 break ---> 14 return model_dir 15 16 UnboundLocalError: local variable 'model_dir' referenced before assignment

jesseengel commented 4 years ago

Hi, sorry I'm reopening this because this is a known issue. What's happening is that you're not fully downloading/zipping the model I believe.

I haven't figured out yet why this sometimes fails. You can try also accessing it directly from drive, or downloading manually from the file browser on the left of Colab. Sorry I don't have a fix yet.

ioannist commented 4 years ago

The first time I downloaded the my_solo_instrument.zip file, it was quite small so I assumed it was broken. The second time I downloaded it, it was 34 MB. However, the file inside G-drive is over 50 MB. I also tried unzipping the downloaded file and it appears it is corrupt. Hope that helps!

jesseengel commented 4 years ago

Yup, that matches my (occasional) experience. Sorry I don't have a better idea of what's going on at the moment, just to say that it seems to be intermittent. Power cycling (restarting browser) seems to work sometimes.